Expected Behavior
Currently, the onChange event parameters on the Slider component are (event, value). While this works and is fine in and of itself, it is not consistent with the function parameters for other onChange events within the core Material UI library. For example, the v1 TextField component has onChange parameter of (event) with the value of the event itself being bound in the nested property event.target.value, as does the Select component.
The latter way of doing things seems to be "more correct". Doing it that way would help developers like myself generalize input behavior across different components (including Slider) that are used side-by-side.
Current Behavior
Currently, the onChange event parameters on the Slider component are (event, value).
Steps to Reproduce (for bugs)
Just go to the first example on the Material UI website: https://material-ui.com/demos/selects/#simple-select
Context
I'm trying to tie a TextField component to a Slider component so that the user has a choice over what input type to use. I have a general handleInput method which takes event.target.value and assigns it to the state of my React component, which I would also like to use with the Select component but can't without first wrapping the onChange event like so:
onChange={(event, val) => this.handleInput({ event: { target: { value: val } } })}
Your Environment
| Tech |
Version |
| Material-UI |
v1.1.0 |
| React |
v16.4.0 |
| material-ui/lab |
v1.0.0-alpha.5 |
Expected Behavior
Currently, the
onChangeevent parameters on theSlidercomponent are(event, value). While this works and is fine in and of itself, it is not consistent with the function parameters for otheronChangeevents within the core Material UI library. For example, the v1TextFieldcomponent hasonChangeparameter of(event)with the value of the event itself being bound in the nested propertyevent.target.value, as does theSelectcomponent.The latter way of doing things seems to be "more correct". Doing it that way would help developers like myself generalize input behavior across different components (including
Slider) that are used side-by-side.Current Behavior
Currently, the
onChangeevent parameters on theSlidercomponent are(event, value).Steps to Reproduce (for bugs)
Just go to the first example on the Material UI website: https://material-ui.com/demos/selects/#simple-select
Context
I'm trying to tie a
TextFieldcomponent to aSlidercomponent so that the user has a choice over what input type to use. I have a generalhandleInputmethod which takesevent.target.valueand assigns it to the state of my React component, which I would also like to use with theSelectcomponent but can't without first wrapping theonChangeevent like so:Your Environment