Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API or documentation to change the width of the overlay #7

Open
jcgueriaud1 opened this issue Oct 27, 2020 · 2 comments
Open

Add API or documentation to change the width of the overlay #7

jcgueriaud1 opened this issue Oct 27, 2020 · 2 comments

Comments

@jcgueriaud1
Copy link
Contributor

Add API or documentation to change the width of the overlay

@jcgueriaud1
Copy link
Contributor Author

Related to this:
https://github.com/vaadin/vaadin-combo-box/issues/892

A workaround:
comboBox.getElement().getStyle().set("--vaadin-combo-box-overlay-width", "400px")

vaadin/vaadin-combo-box#942

@jcgueriaud1
Copy link
Contributor Author

It's also possible to get the maximum length of the items (for example "John Doe") and set the width "dynamically" in characters width: 8ch.

like comboBox.getElement().getStyle().set("--vaadin-combo-box-overlay-width", "calc( margin/padding + max_value ch )").

It requires some calculation and all the data in memory to calculate the maximum width.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant