Skip to content

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

devongovett
devongovett previously approved these changes Feb 6, 2026
Copy link
Member

@devongovett devongovett left a comment

Choose a reason for hiding this comment

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

Maybe we can make a helper function for this pattern: nodeContains(e.currentTarget, getEventTarget(e)), seems super common.

reidbarber
reidbarber previously approved these changes Feb 9, 2026
# Conflicts:
#	packages/@react-aria/utils/src/useViewportSize.ts
@snowystinger snowystinger dismissed stale reviews from reidbarber and devongovett via 47111d7 February 9, 2026 19:50
# Conflicts:
#	eslint.config.mjs
#	packages/@react-aria/calendar/src/useCalendarCell.ts
#	packages/@react-aria/dnd/src/DragManager.ts
#	packages/@react-aria/grid/src/useGridCell.ts
#	packages/@react-aria/gridlist/src/useGridListItem.ts
#	packages/@react-aria/interactions/src/useFocusVisible.ts
#	packages/@react-aria/interactions/src/utils.ts
#	packages/@react-aria/menu/src/useSubmenuTrigger.ts
#	packages/@react-aria/overlays/src/usePreventScroll.ts
#	packages/@react-aria/selection/src/useSelectableCollection.ts
#	packages/@react-aria/selection/src/useSelectableItem.ts
#	packages/@react-aria/toolbar/src/useToolbar.ts
#	packages/@react-aria/utils/src/useViewportSize.ts
#	packages/dev/eslint-plugin-rsp-rules/index.js
@rspbot
Copy link

rspbot commented Feb 9, 2026

@rspbot
Copy link

rspbot commented Feb 9, 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
 }

@snowystinger snowystinger added this pull request to the merge queue Feb 9, 2026
Merged via the queue into main with commit 218e670 Feb 9, 2026
29 checks passed
@snowystinger snowystinger deleted the alternate-fix-all-event-target-for-shadow-dom branch February 9, 2026 23:31
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.

5 participants