Skip to content

Commit

Permalink
Remove use of Object.assign, fixes JedWatson#1987
Browse files Browse the repository at this point in the history
  • Loading branch information
JedWatson committed Sep 12, 2017
1 parent f0722ec commit 195964a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand Down

0 comments on commit 195964a

Please sign in to comment.