Skip to content

do not propagate events through portal - #1840

Merged
dannify merged 9 commits into
mainfrom
prevent-portal-bubbling
May 28, 2021
Merged

dannify merged 9 commits into
mainfrom
prevent-portal-bubbling

Conversation

@jluyau

@jluyau jluyau commented Apr 24, 2021 •

Copy link
Copy Markdown
Member

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
Copy Markdown

Build successful! 🎉

@snowystinger snowystinger left a comment

Copy link
Copy Markdown
Member

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?

@jluyau

jluyau commented May 4, 2021

Copy link
Copy Markdown
Member Author

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
Copy Markdown

Build successful! 🎉

@snowystinger

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 (!state.ignoreEmulatedMouseEvents && e.button === 0) {
triggerPressUp(e, state.pointerType);
}

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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