[Bug Report] Weird behaviour inside shadow DOM
See original GitHub issueVersions and Environment
Vuetify: 1.5.14 Vue: 2.6.10 Browsers: Google Chrome OS: Linux x86_64
Steps to reproduce
- Render vuetify inside shadow dom
- Functionality becomes very limited, such as:
- Cannot focus for text fields
- Menuable items cannot be attached to
VApp
- Menuable items cannot be attached by selectors
Expected Behavior
Clicking on the text field should show that the text field is focused
The select list should work even without attach
property
Actual Behavior
The text field does not react on clicks or activating via tab
The select list does not open without attach
property
Reproduction Link
https://codepen.io/anon/pen/rEjXRj
Other comments
Possible culprit:
document.activeElement
inside ofonFocus
inVTextField
does not work in shadow domdocument.querySelector
does not work in shadow dom
Possible solutions:
- calculate actual root with
getRootNode
(might require polyfill on Edge and IE11) - track
VApp
and usequerySelector
directly on theVApp
element
I could not find any workarounds that vuetify can offer for this issue at this moment.
Issue Analytics
- State:
- Created 4 years ago
- Comments:20 (10 by maintainers)
Top Results From Across the Web
Firefox shadow DOM contenteditable bug - v6 - CodeMirror
It appears that contenteditables inside shadow DOMs have been problematic for Firefox for years now.
Read more >918357 - scrollIntoView is not working inside shadow dom
My reading of the bug report is that this is a spec deficiency in the interaction between scrollIntoView() and shadow DOM elements, ...
Read more >1018269 - @keyframes doesn't work inside shadow dom
I don't know whether this bug is the result of the shadow dom, the @import or the combination of the two, but @keyframes...
Read more >Shadow DOM - W3C
The following is the tentative summary of the discussions in the W3C bugs. We, however, haven't covered all HTML Elements and their behaviors...
Read more >Dialogs and shadow DOM: can we make it accessible?
Shadow DOM is weird. On paper, it doesn't actually change what you can do in the DOM – with open mode, at least,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There are no plans currently to support web components
See also #4075, #5054, #6203
There are other consideration than only the use of
document
. For example, the use ofrem
css units will prevent overriding the font-size of elements inside the shadow dom.I don’t expect the Vuetify team to implement these changes in Vuetify 2.x (although it would be nice). But you guys should consider this when writing Vuetify 3. IMO, a proper framework should not assume that it is the only think running on the page and allow to be scoped to a particular DOM element.