From 8baafe438d2088bd79ef44068ff76099ffc8bbe0 Mon Sep 17 00:00:00 2001 From: nickofolas Date: Mon, 9 May 2022 19:32:32 -0500 Subject: [PATCH] Fix options sliders not sliding --- src/GameOptions/ui/CurrentOptionsPage.tsx | 12 ++++++------ src/GameOptions/ui/OptionsSlider.tsx | 15 +++++++++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/GameOptions/ui/CurrentOptionsPage.tsx b/src/GameOptions/ui/CurrentOptionsPage.tsx index ff154f768..f34245a3b 100644 --- a/src/GameOptions/ui/CurrentOptionsPage.tsx +++ b/src/GameOptions/ui/CurrentOptionsPage.tsx @@ -70,7 +70,7 @@ export const CurrentOptionsPage = (props: IProps): React.ReactElement => { <> { /> { /> { /> { /> { /> void; step: number; min: number; @@ -13,14 +13,21 @@ interface IProps { } export const OptionsSlider = (props: IProps): React.ReactElement => { + const [value, setValue] = useState(props.initialValue); + + const onChange = (_evt: Event, newValue: number | Array): void => { + setValue(newValue); + }; + return ( {props.tooltip}}> {props.label} props.callback(evt, value)} step={props.step} min={props.min} max={props.max}