Skip to content

Shadow DOM support for ariaHideOutside#6160

Closed
MahmoudElsayad wants to merge 14 commits intoadobe:mainfrom
ritz078:ariaHideOutside-shadow-dom-support
Closed

Shadow DOM support for ariaHideOutside#6160
MahmoudElsayad wants to merge 14 commits intoadobe:mainfrom
ritz078:ariaHideOutside-shadow-dom-support

Conversation

@MahmoudElsayad
Copy link
Contributor

@MahmoudElsayad MahmoudElsayad commented Apr 5, 2024

Closes #6133

Changes

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

🧢 Your Project:

PSPDFKit -

@devongovett devongovett force-pushed the main branch 2 times, most recently from 8cb1a5d to 3013156 Compare July 23, 2024 22:43
@devongovett devongovett force-pushed the main branch 2 times, most recently from a79adcf to 3013156 Compare September 30, 2024 21:00
const shadowRoots = findShadowRoots(targets);

if (shadowRoots.length > 0) {
const targetsByShadowRoot = new Map<ShadowRoot, Element[]>();
Copy link
Contributor

Choose a reason for hiding this comment

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

The function ariaHideOutside already accepts a root element. Can we make this generic so that any element can be treated as root and not just the document.body or shadow root ? If an element passed as root is inside shadow root, even that should work. Does this make sense ?

This means that all the hooks using this function should also accept a custom root and should pass this information to this element.

@snowystinger
Copy link
Member

Thanks for your patience, I know this has been slow, but thank you so very much for the unit tests. They were really helpful to me when I was verifying my changes here feat: Update aria hide outside to work with shadow doms
I'm going to close this PR in favour of the new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ariaHideOutside incorrect behavior inside shadow DOM.

3 participants