From 8ec1fcff5249fb91386c9bfa6f4da13807e51071 Mon Sep 17 00:00:00 2001 From: Garth Williams Date: Tue, 8 Sep 2015 15:44:21 +0200 Subject: [PATCH] SelectField now triggers on change consistently when using props.value fixes #1608 --- src/drop-down-menu.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/drop-down-menu.jsx b/src/drop-down-menu.jsx index cee002f7d8f885..7267cb10e2108c 100644 --- a/src/drop-down-menu.jsx +++ b/src/drop-down-menu.jsx @@ -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); }