New to KendoReact? Start a free 30-day trial
Auto-Resizing KendoReact DropdownList to Fit Longest List Item
Environment
Product Version | 11.3.1 |
Product | Progress® KendoReact DropDownList |
Description
When using the KendoReact 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 KendoReact DropDownList auto-resize to fit the longest item?
- What is the workaround for clipping long items in KendoReact DropDownList?
- How to programmatically set the width of KendoReact DropDownList?
Solution
To ensure the KendoReact 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.
Change Theme
Theme
Loading ...