From 69e0c60c2d05aa9c84d95a473bd1287efa85ee88 Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Fri, 5 Jun 2020 07:55:09 -0700 Subject: [PATCH] [Metrics UI] Handle event.target properly for Legend Controls (#68029) (#68334) Co-authored-by: Elastic Machine Co-authored-by: Elastic Machine --- .../inventory_view/components/waffle/legend_controls.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx index 7929cf8292cb61..538cd5f7d9525a 100644 --- a/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/inventory_view/components/waffle/legend_controls.tsx @@ -141,14 +141,16 @@ export const LegendControls = ({ const handleStepsChange = useCallback( (e) => { - setLegendOptions((previous) => ({ ...previous, steps: parseInt(e.target.value, 10) })); + const steps = parseInt(e.target.value, 10); + setLegendOptions((previous) => ({ ...previous, steps })); }, [setLegendOptions] ); const handlePaletteChange = useCallback( (e) => { - setLegendOptions((previous) => ({ ...previous, palette: e.target.value })); + const palette = e.target.value; + setLegendOptions((previous) => ({ ...previous, palette })); }, [setLegendOptions] );