Skip to content

Commit

Permalink
Merge pull request mui#1610 from garth/fix-select-field-onchange
Browse files Browse the repository at this point in the history
SelectField now triggers on change consistently when using props.value
  • Loading branch information
shaurya947 committed Nov 10, 2015
2 parents 2a16e58 + 8ec1fcf commit db23297
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/drop-down-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ const DropDownMenu = React.createClass({
},

_onMenuItemClick(e, key, payload) {
if (this.props.onChange && this.state.selectedIndex !== key) {
let selectedItem = this.props.menuItems[key];
if (selectedItem) {
e.target.value = selectedItem[this.props.valueMember];
}
let selectedItem = this.props.menuItems[key];
if (selectedItem) {
e.target.value = selectedItem[this.props.valueMember];
}

if (this.props.onChange && (this.state.selectedIndex !== key || e.target.value !== this.props.value)) {
if (this.props.valueLink) {
this.props.valueLink.requestChange(e.target.value);
}
Expand Down

0 comments on commit db23297

Please sign in to comment.