Skip to content

Commit

Permalink
[Metrics UI] Handle event.target properly for Legend Controls (elasti…
Browse files Browse the repository at this point in the history
…c#68029) (elastic#68334)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
simianhacker and elasticmachine authored Jun 5, 2020
1 parent db6ae3f commit 69e0c60
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
);
Expand Down

0 comments on commit 69e0c60

Please sign in to comment.