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

fix: ignore touchstart events for closing modal popups #3087

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

brian-smith-tcril
Copy link
Contributor

@brian-smith-tcril brian-smith-tcril commented Jun 11, 2024

Description

Resolves #3081

react-focus-on was picking up touchstart events for onClickOutside - resulting in onClose being called before the click event was sent to the button. This PR just wraps the call to onClose in a small function that filters out touchstart events.

Deploy Preview

https://deploy-preview-3087--paragon-openedx.netlify.app/components/modal/modal-popup/

Merge Checklist

  • If your update includes visual changes, have they been reviewed by a designer? Send them a link to the Netlify deploy preview, if applicable.
  • Does your change adhere to the documented style conventions?
  • Do any prop types have missing descriptions in the Props API tables in the documentation site (check deploy preview)?
  • Were your changes tested using all available themes (see theme switcher in the header of the deploy preview, under the "Settings" icon)?
  • Were your changes tested in the example app?
  • Is there adequate test coverage for your changes?
  • Consider whether this change needs to reviewed/QA'ed for accessibility (a11y). If so, please request an a11y review for the PR in the #wg-paragon Open edX Slack channel.

Post-merge Checklist

  • Verify your changes were released to NPM at the expected version.
  • If you'd like, share your contribution in #show-and-tell.
  • 🎉 🙌 Celebrate! Thanks for your contribution.

Copy link

netlify bot commented Jun 11, 2024

Deploy Preview for paragon-openedx ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 65bc658
🔍 Latest deploy log https://app.netlify.com/sites/paragon-openedx/deploys/6668b5d0ff49030008feaedc
😎 Deploy Preview https://deploy-preview-3087--paragon-openedx.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.21%. Comparing base (d4b08db) to head (65bc658).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3087   +/-   ##
=======================================
  Coverage   93.20%   93.21%           
=======================================
  Files         249      249           
  Lines        4359     4363    +4     
  Branches     1000     1037   +37     
=======================================
+ Hits         4063     4067    +4     
+ Misses        293      290    -3     
- Partials        3        6    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brian-smith-tcril brian-smith-tcril marked this pull request as draft June 11, 2024 18:48
@brian-smith-tcril brian-smith-tcril marked this pull request as ready for review June 12, 2024 03:11
Copy link
Member

@adamstankiewicz adamstankiewicz left a comment

Choose a reason for hiding this comment

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

LGTM, once we've verified the solution is cross-browser compatible as discussed in Paragon Working Group, at least according to the supported browsers in browserslist-config (source).

@brian-smith-tcril
Copy link
Contributor Author

I have verified this on:

safari-ios-17.webm
safari-ios-16.webm
safari-ios-15.webm
firefox-android-12.webm
chrome-android-12.webm
chrome-mac-125.webm
chrome-mac-126.webm
firefox-mac-126.webm
firefox-mac-127.webm
edge-125.webm
edge-126.webm
safari-mac-16.5.webm
safari-mac-17.3.webm

I didn't test all 3 latest versions of Firefox and Chrome on Android, instead I just tested the third oldest, but I am confident this testing is enough to show the fix works.

@brian-smith-tcril brian-smith-tcril merged commit ae3cdee into openedx:master Jun 20, 2024
10 checks passed
@openedx-semantic-release-bot

🎉 This PR is included in version 22.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: ModalPopup doesn't close on button click on mobile devices
3 participants