You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I created that button programatically and inserted it inside the wrapped web component then this wrapper will simply pick that up and create VNode out of it for Vue to render. This is bad because if I attach an event listener to this element then it simply wont ever be called as the element rendered is not the same as the one I'm attaching a listener to.
I'm not certain on a good solution though, I think this needs to be handled outside of Vue. Possibly instead of creating a VNode from the element itself we could render a native slot element here and leave the slot handling up to the browser/polyfill where this may not be a problem?
Modified toVNode method to understand the 'potential' solution above:
If I'm reading this correctly does this mean the vue-web-component-wrapper does not implement a native version of slots for webcomponents? I'm having difficulty even getting mine to show up, and this issue does raise concerns because for our use case we require native slot implementation, not a psudeo one which mimics how slots are supposed to work
Here the same issue about event listeners attached to elements inside slots. Any update on that? @TomCaserta I try your solution and it works well. Please, can you open a related pull request?
This is really makes me sad. I think that it looks more like bug rather than enhancement. It's not possible to insert embedded content inside slot, because it duplicates iframes and sends several request to external source, but must only one. I have duplicated sound from to html element 😢
The slotted content appears to just be a clone of whatever is inside the web-components body. For example if I had:
If I created that button programatically and inserted it inside the wrapped web component then this wrapper will simply pick that up and create
VNode
out of it for Vue to render. This is bad because if I attach an event listener to this element then it simply wont ever be called as the element rendered is not the same as the one I'm attaching a listener to.I'm not certain on a good solution though, I think this needs to be handled outside of Vue. Possibly instead of creating a VNode from the element itself we could render a native slot element here and leave the slot handling up to the browser/polyfill where this may not be a problem?
Modified
toVNode
method to understand the 'potential' solution above:The text was updated successfully, but these errors were encountered: