Skip to content

Commit

Permalink
Replace Object.assign with destructuring in SelectWithPlaceholder
Browse files Browse the repository at this point in the history
`Object.assign` is not supported in IE11. Previously changing the selects did not work, but this fixes it.

Fixes elastic#63131.
  • Loading branch information
smith committed Apr 9, 2020
1 parent 783e3c1 commit f3b0b8d
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ export const SelectWithPlaceholder: typeof EuiSelect = props => {
value={isEmpty(props.value) ? NO_SELECTION : props.value}
onChange={e => {
if (props.onChange) {
const customEvent = Object.assign(e, {
target: Object.assign(e.target, {
const customEvent = {
...e,
target: {
...e.target,
value: e.target.value === NO_SELECTION ? '' : e.target.value
})
});
}
};
props.onChange(customEvent);
}
}}
Expand Down

0 comments on commit f3b0b8d

Please sign in to comment.