question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug Report] Weird behaviour inside shadow DOM

See original GitHub issue

Versions and Environment

Vuetify: 1.5.14 Vue: 2.6.10 Browsers: Google Chrome OS: Linux x86_64

Steps to reproduce

  1. Render vuetify inside shadow dom
  2. 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 of onFocus in VTextField does not work in shadow dom
  • document.querySelector does not work in shadow dom

Possible solutions:

  • calculate actual root with getRootNode (might require polyfill on Edge and IE11)
  • track VApp and use querySelector directly on the VApp element

I could not find any workarounds that vuetify can offer for this issue at this moment.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

25reactions
KaelWDcommented, Jun 21, 2019

There are no plans currently to support web components

See also #4075, #5054, #6203

7reactions
matthieusiebencommented, Jun 18, 2020

There are other consideration than only the use of document. For example, the use of rem 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found