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

[ClickAwayListener] Trigger in mouseup instead of click #29975

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 30, 2021

tap-highlight-click-away.mp4

Note that this usually isn't an issue since iOS only applies the tap highlight if the element with an explicit onclick takes up a small portion of the screen (or parent?). As far as I can tell it's <30% (see https://trac.webkit.org/browser/webkit/trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm?rev=286260#L2096. I don't actually know for sure if the linked value is responsible but looking at the code overall I'm fairly certain these are the iOS tap heuristics).

Basically we apply click-away heuristics while processing mouseup instead of click.

Note that this change needs extensive manual testing and has the potential of breaking existing applications that relied on clickaway firing after mouseup events finished bubbling.

Browser run: https://app.circleci.com/pipelines/github/mui-org/material-ui/57385/workflows/d26c82b1-22e6-41c7-87ec-13683dab9b0c

@eps1lon eps1lon added the component: ClickAwayListener The React component label Nov 30, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented Nov 30, 2021

Details of bundle changes

Generated by 🚫 dangerJS against 243aeca

@eps1lon eps1lon force-pushed the fix/clickawaylistener/tappable branch from 38f76f6 to 3f18d06 Compare November 30, 2021 19:29
@eps1lon eps1lon marked this pull request as ready for review November 30, 2021 19:54
@eps1lon eps1lon added the new feature New feature or request label Nov 30, 2021
@eps1lon eps1lon mentioned this pull request Dec 1, 2021
2 tasks
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 23, 2022
@siriwatknp
Copy link
Member

Note that this change needs extensive manual testing and has the potential of breaking existing applications that relied on clickaway firing after mouseup events finished bubbling.

Would this be considered as breaking change? If yes, should we add it to v6?

@DiegoAndai DiegoAndai added v7.x and removed v6.x labels Dec 26, 2023
@DiegoAndai DiegoAndai added this to the Material UI: v7 draft milestone Dec 26, 2023
@michaldudak michaldudak removed their request for review July 26, 2024 15:32
@mnajdova mnajdova changed the base branch from v5.x to master October 3, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ClickAwayListener The React component new feature New feature or request PR: out-of-date The pull request has merge conflicts and can't be merged v7.x
Projects
None yet
6 participants