Skip to content

Commit

Permalink
SelectField now triggers on change consistently when using props.value
Browse files Browse the repository at this point in the history
fixes mui#1608
  • Loading branch information
garth committed Sep 8, 2015
1 parent 82bc1cb commit ba9fad5
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 @@ -281,12 +281,12 @@ let 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 ba9fad5

Please sign in to comment.