Prashant Kumar
Prashant Kumar

Reputation: 290

How to remove wrapped line from Combobox option. - RapidClipseX/Vaadin 14

I am Using RapidclipseX and Vaadin 14, I want to know how to make this Combobox option not wrapped?

Thanks in advance.

Upvotes: 0

Views: 366

Answers (1)

Enver Haase
Enver Haase

Reputation: 74

An obvious answer is to set the width of the ComboBox to be wider, e.g. comboBox.setWidth("200px").

https://www.w3schools.com/cssref/css3_pr_word-wrap.asp Teaches us that there is no other option really then be wide enough to accommodate the entire string.

Assuming that you want a drop-down that's wider than the box: you are using Vaadin 14, so it's important it's not in legacy (10-13) mode so that the new style of CSS is being used. @CssImport(value = "./styles/vaadin-combo-box.css", themeFor = "vaadin-combo-box") would allow you to style the ComboBox.

But, if you look [here] (https://github.com/vaadin/vaadin-combo-box/blob/master/src/vaadin-combo-box.html) you'll see that the vaadin-combo-box-dropdown-wrapper is not a 'part' so it cannot be styled on its own, and expanding the vaadin-text-field will effectively make the whole ComboBox larger.

So you will have to be wide enough with that box or file a feature request on GitHub.

Upvotes: 1

Related Questions