diff --git a/src/GameOptions/ui/OptionsSlider.tsx b/src/GameOptions/ui/OptionsSlider.tsx index 3c12f34a6..b6c213569 100644 --- a/src/GameOptions/ui/OptionsSlider.tsx +++ b/src/GameOptions/ui/OptionsSlider.tsx @@ -2,7 +2,7 @@ import { Slider, Tooltip, Typography, Box } from "@mui/material"; import React, { useState } from "react"; interface IProps { - initialValue: any; + initialValue: number; callback: (event: any, newValue: number | number[]) => void; step: number; min: number; @@ -16,7 +16,7 @@ export const OptionsSlider = (props: IProps): React.ReactElement => { const [value, setValue] = useState(props.initialValue); const onChange = (_evt: Event, newValue: number | Array): void => { - setValue(newValue); + if (typeof newValue === "number") setValue(newValue); }; return (