From 195964a2865e125507ee278e98e9cc3a8f3e3ae3 Mon Sep 17 00:00:00 2001 From: Jed Watson Date: Wed, 13 Sep 2017 03:15:42 +1000 Subject: [PATCH] Remove use of Object.assign, fixes #1987 --- HISTORY.md | 1 + src/Select.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 28b1a1ff08..26a0eeb2de 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,6 +2,7 @@ ## Unreleased +* fixed; removed use of `Object.assign`, fixes IE * added; new `closeOnSelect` prop (defaults to `true`) that controls whether the menu is closed when an option is selected, thanks to [Michael Elgar](https://github.com/melgar) for the original idea * changed; by default, the menu for multi-selects now closes when an option is selected * changed; `Async` component no longer always clears options when one is selected (although the menu is now closed by default). Use `closeOnSelect={false} onSelectResetsInput={false}` to leave the menu open. diff --git a/src/Select.js b/src/Select.js index a46e3ca514..4fd143f74b 100644 --- a/src/Select.js +++ b/src/Select.js @@ -750,8 +750,8 @@ class Select extends React.Component { && !this.state.inputValue }); - // TODO: Check how this project includes Object.assign() - const inputProps = Object.assign({}, this.props.inputProps, { + const inputProps = { + ...this.props.inputProps, role: 'combobox', 'aria-expanded': '' + isOpen, 'aria-owns': ariaOwns, @@ -767,8 +767,8 @@ class Select extends React.Component { onFocus: this.handleInputFocus, ref: ref => this.input = ref, required: this.state.required, - value: this.state.inputValue - }); + value: this.state.inputValue, + }; if (this.props.inputRenderer) { return this.props.inputRenderer(inputProps);