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 4e81c7c commit 8ec1fcf
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 8ec1fcf

Please sign in to comment.