-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Slider does not work in Chrome #1745
Comments
Hi, I'm running on windows 10 and it does not work as it shows in your gif. I'm able to change the slider by clicking on the position of the bar where the value should be set. This only works if I don't start draging the slider at first but directly clicking on the bar. If I drag the slider then I'm not able to click on the bar to change the value. |
@vatanbytyqi I see. I'm running Mac OS so I'll have to check this out on a Windows machine. |
I'm running Windows 7, Chrome Version 45.0.2454.101 m, and the sliders on the material-ui.com website (or in my own app) don't work for me either. I did figure out that this appears to be related to the slider beacon animation. If I wait until the "pulse" of the beacon is finished, then click at a point on the slider it moves. Click and hold never works (the animation is always midway, while holding). To get it to move I have to click on the beacon, wait for the "pulse" to finish, then click somewhere else on the slider, wait for the animation to finish, then click somewhere else. If I click+hold on the beacon, then click somewhere else before the animation is finished, it stops working entirely until I click on the beacon again and wait for the animation to finish. |
I've been looking at this some more and observed the following: If I try to drag the slider then the containing tag gets a class="react-draggable-dragging" which does not go away after releasing the control. If I drag again, then it adds another "react-draggable-dragging", i.e. DOM shows,
If I refresh and start again then click and hold (without actually dragging) and then release, the class=" react-draggable-dragging" appears while click+holding, then disappears on release. Possibly an issue either with the underlying "react-draggable2" or how it is implemented? |
The onDrag event of the slider is not firing. That means it never actually hits the _onDragUpdate event resulting in no changes. After dragging and releasing it never hits _onDragStop. Clicking and holding, then releasing (no dragging movement) causes _onDragStop to fire correctly, which correctly resets the state of the slider. Not too sure why that isn't firing, but looking at the demo of react-draggable2, that does fire the onDrag function as expected. |
I checked this out on a colleague's computer and it worked for him in both Chrome and Firefox on Windows 8. I also came across this issue react-grid-layout/react-grid-layout#29 about dragging not working due to touch screen detection. I then tried forcing isTouchDevice to false in react-draggable2 and that resulted in the sliders actually working! The problem seems to lie with how react-draggable2 detects touch screens - it may not be reliable for all cases (my laptop is not a touch screen, but the windows settings treat it like one). Also, there may be screens which can be either touch or mouse. I then saw a different issue with the slider handle drifting away from the mouse pointer, but that is a separate concern. |
I believe you have pinpointed the cause of the issue. My screen works as a touch screen aswell and when I use my finger the slider works :) |
@vatanbytyqi can you please check if my PR (#1825) fixes your issue? I removed react-draggable dependency at all and in my solution I don't use any touch device detection. So, if your mouse initiated dragging with mousedown then mousemove will be used for moving the handle. |
@igorbt how can I install your branch which has the fix? I tried this: This will add material-ui in node_package where all the other packages are but when I run webpack to generate my app.js I get an error that material-ui can not be found. If I install the master branch with npm install matarial-ui --save then I don't get any error when I run webpack. |
@vatanbytyqi there is another slightly round-about way too: First, run Next, clone @igorbt's repo and check out the branch with the fix using |
thanks @shaurya947 , I managed to complie it but with some errors that I don't think has to do with the clone itself but with my setup. Either way here is the error:
@igorbt your fix did work for my chrome, firefox and edge. |
@vatanbytyqi that's probably because npm is pulling the latest version of React (0.14 was released yesterday). We uploaded a new package to npm that has a temporary fix for loafing React 0.13. So if you do get the latest code from master / npm now, this error shouldn't occur. |
Thanks guys! Good to know that fix worked. |
@vatanbytyqi bug was fixed in PR #1825 and merged, please retest and close. |
I just checked this quickly using the http://material-ui.com site, but the sliders don't work there - has that been updated? |
Not yet.. Not until we do a new release.
|
This was fixed and introduced in a release. |
Slider does not work in Chrome 45.0.2454.101 nor in Microsoft Edge. I can't drag the object and the console does not output any error.
The text was updated successfully, but these errors were encountered: