Select Rich Invoker cloning Option LightDOM nodes #1473
Unanswered
jorenbroekema
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Below is a code snippet where I extend LionOption.
As you can see, there's a small inconvenience here that isn't very intuitive
createRenderRoot
tothis
is possible, but then I lose some of the style encapsulation on LionOption or my own FooOption extension (imagine that I don't extend LionOption here but I extend FooOption which extends LionOption, and FooOption has its own shadow styles that I want to keep intact).Here's the code in LionSelectInvoker that is causing the problem:
As you can see, it only copies over
this.selectedElement.childNodes
but it doesn't do anything with things rendered to the shadowDOM, this is essentially by design, because you can't just copy both without having a custom-element as a "proxy" to make that work. Rendering the selectedElement itself in the invoker would also probably not look great..I think the best way at the moment is my code snippet, but render a custom element of your own to the LightDOM if you need to encapsulate some styles in it, that works alright, but I do feel as though this should probably be documented if that is the best practice here.
Would you say this current behavior is as good as it gets, or do you see potential improvements?
Beta Was this translation helpful? Give feedback.
All reactions