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

Related issues

pola88 picture pola88  路  3Comments

ericraffin picture ericraffin  路  3Comments

ghost picture ghost  路  3Comments

finaiized picture finaiized  路  3Comments

sys13 picture sys13  路  3Comments