When you are dragging a slider, and you move the mouse pointer outside of the browser window, and release the mouse press outside, when you return to the slider, the slider is still dragging along with the mouse even though you are not pressing the mouse key anymore. This isnt an issue with my code, react version etc, as the same issue occurs on the Material UI "demo" page for the slider. However, the issue DOESNT occur in their sandbox example for some reason.
[x] Checked for similar issues. Found a thread from a year ago saying it had been fixed.
[x] Its not related to React or MUI version since the issue also occurs on the MUI demo page for sliders.
When you are dragging a slider, and you move the mouse pointer outside of the browser window, and release the mouse press outside, when you return to the slider, the slider is still dragging along with the mouse even though you are not pressing the mouse key anymore. This isnt an issue with my code, react version etc, as the same issue occurs on the Material UI "demo" page for the slider. However, the issue DOESNT occur in their sandbox example for some reason.
When you drag a slide to an edge, leave the browser window, and release the drag outside, the slider should be left on the edge it was last left on, and not stick to the mouse pointer when you hover back into the browser window.
https://material-ui.com/components/slider/ (DOESNT WORK)
https://codesandbox.io/s/3gtqd (WORKS FINE)
Steps:
|Chrome| Latest |
| React | Latest |
|Material-UI| Latest |
|MacOS Mojave | Latest|
@PCMACHero I can't reproduce the issue. What versions are you using?
Reproducible in 4.4.2 with Chrome 75.0.3770.142 on macOS 10.14.6
@PCMACHero I can't reproduce the issue. What versions are you using?
I didn't get it at first either. When you mouse back in you actually have to enter the slider again.

I don't have to enter the slider again, but perhaps it's different in this slightly older version of Chrome?
Yes, I believe that in my case too, I don't have to specifically hover over the slider again. Either way, it's strange that it works in the sandbox example but not on the demo page or my implementation.
@eps1lon Thanks for the video! I can reproduce it too.
The good news is that the bug is not present in https://v3.material-ui.com/lab/slider/. The regression comes from #16986. I would propose that we revert and that we encourage not to create a new component at each render in #16983 (we already have this constraint with the TransitionComponent prop).
Couldn't reproduce it because I re-entered above the page TOC. At any other point the slider sticks. We're doing something weird with the page TOC I guess.
Im new at MUI. Does your response mean it will fix the issue if I merely downgrade to v3?
@PCMACHero Olivier is suggesting that we revert the fix applied in #16986, and encourage the use described in here: https://github.com/mui-org/material-ui/issues/16983#issuecomment-520836867, presumably in the docs.
Yes, I propose
diff --git a/packages/material-ui/src/Slider/Slider.js b/packages/material-ui/src/Slider/Slider.js
index cac0edc69..8715ae63c 100644
--- a/packages/material-ui/src/Slider/Slider.js
+++ b/packages/material-ui/src/Slider/Slider.js
@@ -568,11 +568,7 @@ const Slider = React.forwardRef(function Slider(props, ref) {
const handleMouseEnter = useEventCallback(event => {
// If the slider was being interacted with but the mouse went off the window
// and then re-entered while unclicked then end the interaction.
- //
- // In Firefox, the event can be triggered when a new DOM node is inserted and hovered.
- // We need to make sure that the relatedTarget (The EventTarget the pointing device exited from)
- // is not null (it should be the html element)
- if (event.buttons === 0 && event.relatedTarget !== null) {
+ if (event.buttons === 0) {
handleTouchEnd(event);
}
});
@PCMACHero If you want to work on the issue, you are welcome :).
@oliviertassinari I want to work on this issue. With which solution are we going?
@neon98 I have proposed a single solution. Point 1 and 2 are two sides of the same fix. Thanks for the care :).
@oliviertassinari my bad! I'll submit the PR soon :D
@neon98 Note that "good first issues" are meant to help new contributors get started, after a few, you should be able to move to harder issues :).
@oliviertassinari definitely :)