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

overlay being moved to document.body makes styling items difficult #183

Closed
ktiedt opened this issue Mar 1, 2016 · 4 comments
Closed

overlay being moved to document.body makes styling items difficult #183

ktiedt opened this issue Mar 1, 2016 · 4 comments

Comments

@ktiedt
Copy link

ktiedt commented Mar 1, 2016

Is there some trick to managing styles for this?

@Saulis
Copy link
Contributor

Saulis commented Mar 1, 2016

Hi there!

Currently, you need to unfortunately set a global style for vaadin-combo-box-overlay to be able to style it. If you need to style various combo-boxes differently, you need to set an id or a custom class to the specific overlay using combobox1.$.overlay and then use a CSS selector specific to that overlay.

This was a tradeoff when we decided to place the overlay under document.body, but we might need to reconsider this when we start working on styling and templating support.

@jouni
Copy link
Member

jouni commented Mar 24, 2016

One of the main reasons for moving it under body was to escape any stacking contexts that might crop the overlay element. We currently have the same issue now in vaadin-date-picker, where we still use iron-dropdown: vaadin/vaadin-date-picker#133

HTML5 <dialog> element would be the obvious solution to this issue, but unfortunately it’s not supported anywhere really (Chome has it under a flag): http://caniuse.com/#search=dialog

So either we accept a less convenient way of styling, or we accept the limitation of using these elements inside any overflow: hidden elements with their own stacking context. Both options suck for their own reasons.

@panuhorsmalahti
Copy link
Contributor

Setting a global style wouldn't work with a native Shadow DOM, right?

I was thinking that setting styles with combobox1.$.overlay.style would be an option here too.

@Saulis
Copy link
Contributor

Saulis commented Jan 23, 2017

I'm going to close this ticket as #165 was fixed – we'll be releasing the new custom item template support shortly. Meanwhile, you can already check the master branch how it works.

Feel free to re-open the ticket or open a new one if there are some use cases you feel is not achievable.

@Saulis Saulis closed this as completed Jan 23, 2017
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

4 participants