Skip to content
This repository was archived by the owner on Sep 22, 2022. It is now read-only.

Add support for Shadow DOM & convert to TypeScript #56

Merged
merged 7 commits into from
May 6, 2020
Merged

Conversation

muan
Copy link
Contributor

@muan muan commented May 4, 2020

Similar to github/clipboard-copy-element#26.

Essentially whenever we want document we should retrieve rootNode from the current context.

On getRootNode() (spec):

  • Calling it on an element inside a standard web page will return an HTMLDocument object representing the entire page.
  • Calling it on an element inside a shadow DOM will return the associated ShadowRoot.

And DocumentOrShadowRoot is where we get activeElement from.

muan added 5 commits May 3, 2020 00:38
Instead of calling document directly we should use getRootNode() to
retrieve the right context.

This fix will ensure dialogs in shadow root's tabbing behavior is
correctly trapped.
@muan muan requested a review from a team May 4, 2020 19:50
Copy link
Contributor

@koddsson koddsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me ✨

Copy link
Contributor

@keithamus keithamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

muan and others added 2 commits May 6, 2020 14:22
Co-authored-by: Kristján Oddsson <[email protected]>
Co-authored-by: David Graham <[email protected]>
@muan muan merged commit 8862388 into master May 6, 2020
@muan muan deleted the shadowDOM branch May 6, 2020 18:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants