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

(WIP) Preventing extraneous click on the wrong element when tapping on overlay elements #2942

Closed
wants to merge 7 commits into from

Conversation

LFDanLu
Copy link
Member

@LFDanLu LFDanLu commented Mar 10, 2022

Closes #1513

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

Follow descriptions in new stories
useModal/issues Click through modals
Date and Time/DatePicker/issues Click through calendar
MenuTrigger menu overlapping buttons

🧢 Your Project:

RSP

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@snowystinger snowystinger changed the title (WIP) preventing extraneous click when tapping on overlay elements Preventing extraneous click on the wrong element when tapping on overlay elements Mar 11, 2022
Comment on lines 133 to 137
<h1>Hello CodeSandbox</h1>
<p>
When closing a modal using a button using react aria useButton with a
regular button behind, the button behind will immediately be clicked.
</p>
Copy link
Member Author

Choose a reason for hiding this comment

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

imma go ahead and remove these and make the story/dialog scrollable

@LFDanLu
Copy link
Member Author

LFDanLu commented Mar 11, 2022

provisional approval for the changes @snowystinger made, can't approve my own PR though haha

@snowystinger
Copy link
Member

snowystinger commented Mar 12, 2022

Do we want to do separate testing of just this branch before we merge it?
Are there any cases we've missed that would be good to cover in a story?

reidbarber
reidbarber previously approved these changes Mar 14, 2022
Copy link
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

LGTM, tested stories in Chrome/FF/Safari, and iPhone Safari.

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@LFDanLu LFDanLu changed the title Preventing extraneous click on the wrong element when tapping on overlay elements (WIP) Preventing extraneous click on the wrong element when tapping on overlay elements Mar 30, 2022
Comment on lines +410 to +413
// prevent browsers from firing a delayed click event after touch end
e.target.addEventListener('touchend', (e) => {
e.preventDefault();
}, {passive: false, once: true});
Copy link
Member Author

Choose a reason for hiding this comment

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

just discovered that something in this PR breaks tapping on checkboxes on my android phone (maybe other components too). Will need to dig to see if there is an alternative

Copy link
Member Author

Choose a reason for hiding this comment

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

todo: double check if we need this in usePress

Copy link

Choose a reason for hiding this comment

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

@LFDanLu any update on the fix for this issue?

Copy link
Member Author

Choose a reason for hiding this comment

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

unfortunately no, haven't had time to continue due to other priorities. There is a workaround in the attached issue if you are interested

@yarastqt
Copy link
Contributor

Hello! Have any progress for this PR?

@LFDanLu
Copy link
Member Author

LFDanLu commented May 22, 2023

@yarastqt Unfortunately haven't been able to pick this back up due to other priorities. If others would like to pick this up in the interim, that would be much appreciated!

@LFDanLu
Copy link
Member Author

LFDanLu commented May 24, 2023

Closing for now until we pick this back up in our priorities.

@LFDanLu LFDanLu closed this May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants