Scope listeners and resources to qwik containers #284
Replies: 2 comments
-
The styles do need to move somewhere though. Perhaps as a sibling to the container if the container isn't html or body? As for the listeners, that can be done too. When the loader gets an event type pushed to it, it could attach the handler to only that container. As for the Task |
Beta Was this translation helpful? Give feedback.
-
We moved this issue to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Qwik Version - 0.9.0
Operating System (or Browser) - macOS Monterey (Chrome v.105)
Which component is affected?
Qwik Runtime
Issue
Since Qwik can be used to implement single views/fragments inside pages (and that can be implemented by generating containers via the containerTagName option in the rendering functions) I think containers implemented using qwik should have their listeners and resources scoped to the container itself and that should not leak out of it (as it currently seems to happen).
This happens with the qwikLoader event listeners and I also saw that styles get moved to the document's head upon interaction, I am not sure, there may be other things that are getting applied on the outside of the container as well.
Another relevant aspect I noticed regarding this lack of scoping is that I cannot place qwik containers inside shadowDoms, since when I attempt that the events listeners get added to the global document and don't effect what's in the shadowDoms.
What ideally should happen is that qwik encapsulates as much as possible under the container's root its own logic without interacting with the global document. That should also allow containers inside shadowDoms to work correctly since from within shadowRoots the dom apis should be the same as the light dom ones.
Additional Information
I think this is sort of a bug, but it could be considered a feature request I'd imagine.
I also mentioned this as one of the alternatives considered for issue Ability to destroy and clean up the QwikLoader listeners (and resources) #281 , I created this new issue since this lack of isolation for containers seems in and of itself an issue to solve.
Beta Was this translation helpful? Give feedback.
All reactions