-
Notifications
You must be signed in to change notification settings - Fork 85
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
[vaadin-grid-tree-toggle] Add a part name to the slot element. #8565
Comments
Using both styles.css:
and
worked. |
Still, it would be great to have a fix because it took 3 days of trying to figure it out and then asking in the forum to get a workaround. On top of it, styling the shadow DOM is not the right way to do it if I understand Vaadin's policy correctly. |
I’m not fond of adding a part to the slot element. It’s already questionable that we change the display value of it. Though, I don't see any real issue with it, apparently it’s discouraged by either by some browser engine devs or spec authors. The simplest fix is to add |
The question is how it behaves, when other elements outside of the toggle are displayed in the grid cell (as a common workaround in Flow is the overriding of the hierarchy column to display the value outside of it)? Removing the display: block and moving the other settings other places would also be suitable solution in my eyes. |
If content is outside the tree toggle, then it doesn't matter what the styles are for the toggle, right? Or I probably misunderstood what you mean. How I read this issue, is specifically about the sizing of elements inside the The purpose of the |
Describe your motivation
The tree toggle overrides the default stylings for
<slot>
, changing itsdisplay
toblock
instead ofcontents
. This leads to the issue, that elements placed into that slot cannot use relative dimensions based on the light dom, but have to have knowledge of the shadow dom.Describe the solution you'd like
To overcome this issue with our current way of styling shadow dom parts, the easiest way seems to be adding a respective part attribute to the slot element, e.g.
allowing devs to target it in the light dom stylings
Might be also a good idea to have the width of the slot set to
100%
by default, but not sure if this may break other things.Describe alternatives you've considered
Adding my own styles
styles.css
shadow dom styling for the toggle element, e.g. frontend/themes/your-theme/components/vaadin-grid-tree-toggle.css
Additional context
Based on https://vaadin.com/forum/t/how-to-get-a-rich-component-for-the-hierarchy-column-have-width-of-the-column/168199
The text was updated successfully, but these errors were encountered: