Skip to content

fix: all event target for shadow dom#9551

Open
snowystinger wants to merge 7 commits intomainfrom
alternate-fix-all-event-target-for-shadow-dom
Open

fix: all event target for shadow dom#9551
snowystinger wants to merge 7 commits intomainfrom
alternate-fix-all-event-target-for-shadow-dom

Conversation

@snowystinger
Copy link
Member

@snowystinger snowystinger commented Jan 29, 2026

Another bulk fix for shadow dom, this lints for event.target and auto fixes to getEventTarget(event) which just defers to event.target under the hood.

Some events are not affected when I could detect that the event was one of our Press events or Drag/Drop events since those don't match native events and don't have the same kinds of properties. Those may eventually need different updates.

Some of these updates were done here:
#8991

This PR should make reviewing other ShadowDOM PRs easier and prevent us from regressing

Follow up to #9485
Replaces #9486

✅ 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:

@rspbot
Copy link

rspbot commented Jan 29, 2026

reidbarber
reidbarber previously approved these changes Jan 29, 2026
@rspbot
Copy link

rspbot commented Jan 29, 2026

@snowystinger snowystinger mentioned this pull request Feb 3, 2026
5 tasks
@rspbot
Copy link

rspbot commented Feb 5, 2026

@rspbot
Copy link

rspbot commented Feb 5, 2026

@rspbot
Copy link

rspbot commented Feb 5, 2026

@rspbot
Copy link

rspbot commented Feb 5, 2026

## API Changes

@react-aria/utils

/@react-aria/utils:getEventTarget

-getEventTarget <T extends Event> {
+getEventTarget <T extends Event | SyntheticEvent> {
   event: T
   returnVal: undefined
 }

/@react-aria/utils:nodeContains

 nodeContains {
-  node: Node | null | undefined
-  otherNode: Node | null | undefined
+  node: Node | Element | null | undefined
+  otherNode: Node | Element | null | undefined
   returnVal: undefined
 }

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants