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

do not propagate events through portal #1840

Merged
merged 9 commits into from May 28, 2021
Merged

Conversation

jluyau
Copy link
Member

@jluyau jluyau commented Apr 24, 2021

Closes #1810

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

Adobe/Quarry

@adobe-bot
Copy link

Build successful! 🎉

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

Out of curiosity, how did you decide or figure out which handlers needed this check?
for instance, why pointerup, but not pointermove?

packages/@react-aria/interactions/test/useHover.test.js Outdated Show resolved Hide resolved
packages/@react-aria/interactions/test/useHover.test.js Outdated Show resolved Hide resolved
packages/@react-aria/interactions/test/usePress.test.js Outdated Show resolved Hide resolved
@jluyau
Copy link
Member Author

jluyau commented May 4, 2021

I wasn't sure if the other events (that I didn't modify) were being triggered in my manual tests. Didn't want to just add the check for every event if it wasn't triggering at all, but I can add to others if needed?

@adobe-bot
Copy link

Build successful! 🎉

@snowystinger
Copy link
Member

Agreed, there are a lot of different interaction paths, however, I think we need to really carefully address all of them. That means doing things like testing the screen reader in FF on windows or whatever else we can think of. Possibly talk to @devongovett about the weirder ones and look through his blog post to track them down as well.

@@ -214,7 +214,6 @@ export function usePress(props: PressHookProps): PressResult {
e.preventDefault();
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to do the check for keyboard events as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah most likely. i'll see if i can add a good test for that

if (!e.currentTarget.contains(e.target as HTMLElement)) {
return;
}

if (!state.ignoreEmulatedMouseEvents && e.button === 0) {
triggerPressUp(e, state.pointerType);
}
Copy link
Member

Choose a reason for hiding this comment

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

Make sure we get all of the events assigned to pressProps. I think maybe touch events are missing? Is there a reason they were not included?

Copy link
Member Author

Choose a reason for hiding this comment

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

i think i had placed them all the functions with an event, but i couldn't tell if they were doing anything or not. should i go ahead and place them in all the pressProps events?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah all of the ones that are on pressProps, not global listeners.

@adobe-bot
Copy link

Build successful! 🎉

@dannify dannify merged commit 1eb59c3 into main May 28, 2021
@dannify dannify deleted the prevent-portal-bubbling branch May 28, 2021 17:54
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.

Focus/clicking issues with dialogs triggered from a table cell
5 participants