-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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] onDragStop and onDragStart events have no value #4926
Comments
I think is you event bind wrong. I wrote a demo for you, and import React from 'react';
import Slider from '../src/Slider';
import injectTapEventPlugin from 'react-tap-event-plugin';
// Needed for onTouchTap
// http://stackoverflow.com/a/34015469/988941
injectTapEventPlugin();
/**
* `SelectField` supports a floating label with the `floatingLabelText` property. This can be fixed in place with the
* `floatingLabelFixed property, and can be customised with the `floatingLabelText` property.
*/
export default class App extends React.Component {
constructor(props) {
super(props);
}
changeSlider(event, value) {
console.log(value);
}
render() {
return (
<Slider
defaultValue={1}
onChange={(event, value) => this.changeSlider(event, value)}
/>
);
}
} |
This is |
Related PR: #4712 |
I have this use-case where the slider's value is changed with a timer (setInterval) but it can be changed by the user if he slides the slider, the problem is that i want to catch the change of the value only if the user slides the slider and this is impossible right now :( because the event we get from onDragStop doesn't have a value attribute. |
We plan on migrating the component to the v1-beta branch. I'm closing the issue for #4793. |
Problem description
One cannot access the Slider's value on events onDragStop and onDragStart.
Edit: neither does onMouseUp work. Only onChange gets the event value attached.
I did
injectTapEventPlugin();
.Steps to reproduce
Returns: Event, undefined, undefined.
Versions
The text was updated successfully, but these errors were encountered: