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

Slider does not work in Chrome #1745

Closed
watta90 opened this issue Sep 28, 2015 · 18 comments
Closed

Slider does not work in Chrome #1745

watta90 opened this issue Sep 28, 2015 · 18 comments
Labels
component: slider This is the name of the generic UI component, not the React module!

Comments

@watta90
Copy link

watta90 commented Sep 28, 2015

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.

@shaurya947
Copy link
Contributor

@vatanbytyqi I can't test with Microsoft edge, but it seems to be working for me in the version of Chrome that you mentioned:
gd6dnchfdz

Could you double check by navigating to the documentation site on Chrome?

@watta90
Copy link
Author

watta90 commented Sep 29, 2015

Hi,

I'm running on windows 10 and it does not work as it shows in your gif.
My version of chrome has also an 'm' at the end:
45.0.2454.101 m

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.

@shaurya947
Copy link
Contributor

@vatanbytyqi I see. I'm running Mac OS so I'll have to check this out on a Windows machine.

@duncandrennan
Copy link

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.

@shaurya947 shaurya947 added the bug 🐛 Something doesn't work label Sep 30, 2015
@duncandrennan
Copy link

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,

<body class="   react-draggable-dragging react-draggable-dragging"

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?

@duncandrennan
Copy link

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.

@duncandrennan
Copy link

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.

@watta90
Copy link
Author

watta90 commented Oct 2, 2015

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 :)

@igorbt
Copy link
Contributor

igorbt commented Oct 7, 2015

@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.

@watta90
Copy link
Author

watta90 commented Oct 7, 2015

@igorbt how can I install your branch which has the fix? I tried this:
npm install git+ssh://[email protected]:igorbt/material-ui.git --save

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.

@shaurya947
Copy link
Contributor

@vatanbytyqi there is another slightly round-about way too: First, run npm install material-ui in your project as regular.

Next, clone @igorbt's repo and check out the branch with the fix using git checkout slider-fix. In this branch, run npm install. This will compile all source files into the lib folder. Now you can use this lib folder to replace the lib folder inside your node_modules/material-ui/ directory in your project.

@watta90
Copy link
Author

watta90 commented Oct 8, 2015

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:

    npm ERR! Windows_NT 10.0.10240
npm ERR! argv "c:\\Program Files (x86)\\nodejs\\node.exe" "c:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.1.0
npm ERR! npm  v2.14.3
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package [email protected] does not satisfy its siblings' peerDependencies requirements!

npm ERR! Please include the following file with any support request:

@igorbt your fix did work for my chrome, firefox and edge.

@shaurya947
Copy link
Contributor

@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.

@igorbt
Copy link
Contributor

igorbt commented Oct 8, 2015

Thanks guys! Good to know that fix worked.

@igorbt
Copy link
Contributor

igorbt commented Oct 15, 2015

@vatanbytyqi bug was fixed in PR #1825 and merged, please retest and close.

@duncandrennan
Copy link

I just checked this quickly using the http://material-ui.com site, but the sliders don't work there - has that been updated?

@shaurya947
Copy link
Contributor

Not yet.. Not until we do a new release.
On Oct 16, 2015 2:37 AM, "Duncan Drennan" [email protected] wrote:

I just checked this quickly using the http://material-ui.com site, but
the sliders don't work there - has that been updated?


Reply to this email directly or view it on GitHub
#1745 (comment)
.

@alitaheri alitaheri added Cross Browser Support and removed bug 🐛 Something doesn't work labels Dec 8, 2015
@alitaheri
Copy link
Member

This was fixed and introduced in a release.

@oliviertassinari oliviertassinari added the component: slider This is the name of the generic UI component, not the React module! label Aug 22, 2020
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

6 participants