From f3b0b8d562bcecc8443ae870b0f9c7186131be3e Mon Sep 17 00:00:00 2001 From: Nathan L Smith Date: Thu, 9 Apr 2020 17:36:52 -0500 Subject: [PATCH] Replace Object.assign with destructuring in SelectWithPlaceholder `Object.assign` is not supported in IE11. Previously changing the selects did not work, but this fixes it. Fixes #63131. --- .../components/shared/SelectWithPlaceholder/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/x-pack/legacy/plugins/apm/public/components/shared/SelectWithPlaceholder/index.tsx b/x-pack/legacy/plugins/apm/public/components/shared/SelectWithPlaceholder/index.tsx index 8698978bfe6fb4..0aed63cbf1443b 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/SelectWithPlaceholder/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/SelectWithPlaceholder/index.tsx @@ -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); } }}