For a very specific reason*, I need a Vue instance to run inside an iframe. I managed to do that following this thread on Vue forum, and tweaking the code to support Vue 3 and removing the slot, because I only need a specific component to run inside an iframe.
But there is a very specific problem that I haven't even managed to start debugging.
As you can see from this minimal reproducible example on CodeSandbox, when a new element is added into the iframe, it takes a considerable amount of time for the user events (namely clicks) to start getting recognised. (it is even more pronounced in my scenario, to the point of being completely unusable)
Does anyone who is well-versed in Vue at least understand why this is happening and if there is a way to prevent it from happening?
Any insight would be much appreciated. Thanks.
*the reason being that I am building a browser extension that injects a sidebar into the page and I need to isolate the CSS, because the extension is to be used on various pages, so it is nearly impossible to prevent all stlyes from leaking into the injected sidebar.
Yes, avoiding an iframe and using #myDiv{ all: unset } instead works to some extent, but fails for some very specific selectors defined in the page's CSS (and outright does not work for input elements). Hunting for them on all pages that I want to support would quickly become a nightmare.