Skip to content

[Tooltip] Ensure user-select CSS property is reverted after touch end#28372

Merged
eps1lon merged 3 commits intomui:masterfrom
tholman:tooltip-user-select-revert-after-press
Sep 16, 2021
Merged

[Tooltip] Ensure user-select CSS property is reverted after touch end#28372
eps1lon merged 3 commits intomui:masterfrom
tholman:tooltip-user-select-revert-after-press

Conversation

@tholman
Copy link
Contributor

@tholman tholman commented Sep 15, 2021

Currently if you tap on a button within a tooltip on mobile (safari/chrome) the user select will be set to 'none', the handleTouchEnd function will remove the touchtimer from the touch start, so the user select ‘none’ will now be left on for the rest of the session.

Demo of the bug here (bug exists in current mui and 5 rc), https://codesandbox.io/s/usage-forked-vow1z?file=/index.js ... if you go to the resolved window on chrome and use a mobile view to trigger event by "tapping" the button, you will see that you can no longer select the text in the document.

@mui-pr-bot
Copy link

mui-pr-bot commented Sep 15, 2021

Details of bundle changes

Generated by 🚫 dangerJS against 02603cd

@tholman tholman changed the title ensure tooltip reverts user-select property after tap start/end [Tootip] ensure tooltip reverts user-select property after tap start/end Sep 15, 2021
@tholman tholman changed the title [Tootip] ensure tooltip reverts user-select property after tap start/end [Tooltip] ensure tooltip reverts user-select property after tap start/end Sep 15, 2021
@tholman tholman changed the base branch from master to next September 15, 2021 22:14
@tholman tholman changed the base branch from next to master September 15, 2021 22:15
@eps1lon eps1lon added type: bug It doesn't behave as expected. scope: tooltip Changes related to the tooltip. labels Sep 16, 2021
Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Thanks for the detailed context and great test. Much appreciated!

@eps1lon eps1lon changed the title [Tooltip] ensure tooltip reverts user-select property after tap start/end [Tooltip] Ensure user-select CSS property is reverted after touch end Sep 16, 2021
@eps1lon eps1lon merged commit 0f24c7c into mui:master Sep 16, 2021
@tholman tholman deleted the tooltip-user-select-revert-after-press branch September 16, 2021 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: tooltip Changes related to the tooltip. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants