New to Kendo UI for VueStart a free 30-day trial

Auto-Resizing Kendo UI for Vue DropdownList to Fit Longest List Item

Environment

Product Version6.4.0
ProductProgress® Kendo UI for Vue DropDownList

Description

When using the Kendo UI for Vue DropDownList, the width does not automatically adjust to fit the longest item in the list unless explicitly set. By default, the component renders with a fixed width based on its container or the initially selected value. This can result in long items being cut off before any selection is made.

This knowledge base article also answers the following questions:

  • How can I make Kendo UI for Vue DropDownList auto-resize to fit the longest item?
  • What is the workaround for clipping long items in Kendo UI for Vue DropDownList?
  • How to programmatically set the width of Kendo UI for Vue DropDownList?

Solution

To ensure the Kendo UI for Vue DropDownList adjusts its width to fit the longest item from the start, calculate the width of the longest item in the list programmatically and set the style.width property of the component.

The following example showcases the described approach in action:

Change Theme
Theme
Loading ...

See Also

In this article
EnvironmentDescriptionSolutionSee Also
Not finding the help you need?
Contact Support