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

[Lab][Slider] touchend event listener is never removed #12922

Closed
2 tasks done
brian-growratio opened this issue Sep 18, 2018 · 1 comment
Closed
2 tasks done

[Lab][Slider] touchend event listener is never removed #12922

brian-growratio opened this issue Sep 18, 2018 · 1 comment
Labels
component: slider This is the name of the generic UI component, not the React module!

Comments

@brian-growratio
Copy link
Contributor

This is for mobile only (or via responsive device emulation in browser dev tools).

Line 291, a touchend event listener is added via handleTouchStart.

document.body.addEventListener('touchend', this.handleMouseUp);

This touchend event listener is not removed in handleMouseUp, which causes handleMouseUp to fire any time the user touches anything on the document after they use the slider for the first time.

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

after using a slider, dragStopEnd should not be triggered by touching another part of the screen

Current Behavior

dragStopEnd is triggered for any touch event.

Steps to Reproduce

Link: https://codesandbox.io/s/4wp7k6l640

  1. Open link to code on mobile, or in chrome with devtools open and device toolbar toggled
  2. use the slider. Note the number beside "Last touchend Event"
  3. touch anywhere else on the document. Not how the number beside "Last touchend Event" changes.

Context

This is a breaking bug on mobile for obvious reasons.

Your Environment

Tech Version
Material-UI v3.1.0
React 16.4.1
Browser Chrome for Android, Chrome
@brian-growratio
Copy link
Contributor Author

Commenting the pull request so there is a comment icon increasing the chances someone will scroll to the bottom to see that a pull request to fix this is already in. Just to potentially save someone some work, lol.

#12923

@oliviertassinari oliviertassinari added the component: slider This is the name of the generic UI component, not the React module! label Aug 22, 2020
@oliviertassinari oliviertassinari removed the package: lab Specific to @mui/lab label Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: slider This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

2 participants