material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

Slider doesn't sync with mouse when dragging right slowly

Open chbdetta opened this issue 11 years ago • 4 comments

the slider doesn't keep sync with the mouse once you move the mouse very slowly to the right. I find that this is caused by the dependency react-draggable2 and already fixed it. but I don't know where to pull request. the original code at line 611 in react-draggable2/lib/draggable.js

// Save new 
state.clientX = this.state.clientX + (state.offsetLeft - offsetLeft);
state.clientY = this.state.clientY + (state.offsetTop - offsetTop);

after I modified:

// Save new state
state.clientX = state.offsetLeft + offsetParent.getBoundingClientRect().left;
state.clientY = state.offsetTop + offsetParent.getBoundingClientRect().top;

chbdetta avatar Sep 02 '15 05:09 chbdetta

Thanks so much! I was wondering about this :)

You should submit a PR to draggable, in which case the PR to Material-UI would just be to bump the dependency version of draggable.

If you want I can do it.

nalnaji avatar Sep 10 '15 18:09 nalnaji

thanks for the advice! I've submitted a PR to draggable and now just waiting for its author to merge. :^)

chbdetta avatar Sep 14 '15 01:09 chbdetta

@chbdetta, can you please check if my PR (#1825) fixes your issue? I removed react-draggable dependency at all and it fixed for me also this issue that you reported.

igorbt avatar Oct 07 '15 11:10 igorbt

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

igorbt avatar Oct 15 '15 20:10 igorbt