Material-ui: [SelectField] "onChange" event doesn't pass enough parameters

Created on 17 Jul 2015  ·  3Comments  ·  Source: mui-org/material-ui

When I use SelectField componect the callback "onChange" only pass through the event object.
It makes sense to know the which item is selected.

Here is a piece of source code in select-field.jsx

onChange(e, index, payload) {
if (payload) {
e.target.value = payload[this.props.valueMember] || payload;
}
if (this.props.onChange) {
this.props.onChange(e);
}
}

I think it should be a missing to forget to pass "index" to onChange

Most helpful comment

How to pass more parameters in onchange? Whats the syntax?

All 3 comments

You can use event.target.value. See https://facebook.github.io/react/docs/forms.html.

Fixed with #1194

How to pass more parameters in onchange? Whats the syntax?

Was this page helpful?
0 / 5 - 0 ratings