Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tooltip): fix focusing tooltip when a referenceElement is within a shadowDOM #6915

Merged
merged 16 commits into from May 9, 2023

Conversation

driskull
Copy link
Member

@driskull driskull commented May 3, 2023

Related Issue: #6893

Summary

  • When a tooltip's reference element is inside a shadowRoot, the focusin and focusout handlers are not activating
    • This is because the event handlers are on the document and wont' work inside a shadowRoot
  • This PR sets up these focus handlers on each shadowRoot necessary
  • Only sets up the focus listeners once per shadowRoot by keeping a count of referenceElements with the same shadowRoot.
  • Adds getShadowRootNode dom utility to get an elements rootNode if the rootNode is a shadowRoot element.

@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label May 3, 2023
@driskull driskull marked this pull request as ready for review May 3, 2023 22:07
@driskull driskull requested a review from a team as a code owner May 3, 2023 22:07
@driskull driskull added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label May 3, 2023
@driskull driskull requested a review from jcfranco May 3, 2023 23:22
@driskull driskull requested a review from jcfranco May 5, 2023 17:50
@driskull driskull added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 5, 2023
@driskull driskull removed the pr ready for visual snapshots Adding this label will run visual snapshot testing. label May 5, 2023
…om:Esri/calcite-components into dris0000/tooltip-shadow-root-focus-support
@driskull driskull added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label May 5, 2023
Copy link
Member

@jcfranco jcfranco left a comment

Choose a reason for hiding this comment

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

Pure awesomeness, @driskull!

🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍
🔍🔍👁👁👁🔍🔍👁👁🔍🔍🔍👁👁🔍🔍👁🔍🔍🔍👁🔍
🔍👁🔍🔍🔍🔍👁🔍🔍👁🔍👁🔍🔍👁🔍👁🔍🔍🔍👁🔍
🔍👁🔍🔍🔍🔍👁🔍🔍👁🔍👁🔍🔍👁🔍👁🔍🔍🔍👁🔍
🔍👁🔍🔍🔍🔍👁🔍🔍👁🔍👁🔍🔍👁🔍👁🔍🔍🔍🔍🔍
🔍🔍👁👁👁🔍🔍👁👁🔍🔍🔍👁👁🔍🔍👁👁👁🔍👁🔍
🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍🔍

src/components/tooltip/tooltip.e2e.ts Outdated Show resolved Hide resolved
src/components/tooltip/TooltipManager.ts Show resolved Hide resolved
@driskull driskull removed the pr ready for visual snapshots Adding this label will run visual snapshot testing. label May 9, 2023
@driskull driskull added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 9, 2023
@driskull driskull added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label May 9, 2023
@driskull driskull merged commit 453d527 into master May 9, 2023
14 checks passed
@driskull driskull deleted the dris0000/tooltip-shadow-root-focus-support branch May 9, 2023 17:55
@github-actions github-actions bot added this to the 2023 May Priorities milestone May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants