diff --git a/src/components/room/widgets/furniture/FurnitureStackHeightView.tsx b/src/components/room/widgets/furniture/FurnitureStackHeightView.tsx index f3a73b6c..56ea477f 100644 --- a/src/components/room/widgets/furniture/FurnitureStackHeightView.tsx +++ b/src/components/room/widgets/furniture/FurnitureStackHeightView.tsx @@ -7,7 +7,7 @@ import { useFurnitureStackHeightWidget } from '../../../../hooks'; export const FurnitureStackHeightView: FC<{}> = props => { - const { objectId = -1, height = 0, maxHeight = 40, onClose = null, updateHeight = null } = useFurnitureStackHeightWidget(); + const { objectId = -1, height = 0, maxHeight = 40, onClose = null, setHeight = null } = useFurnitureStackHeightWidget(); if(objectId === -1) return null; @@ -22,10 +22,10 @@ export const FurnitureStackHeightView: FC<{}> = props => min={ 0 } max={ maxHeight } step={ 0.01 } - value={ height } - onChange={ event => updateHeight(event) } + value={ isNaN(parseFloat(height.toString())) ? 0 : parseFloat(height.toString()) } + onChange={ event => setHeight(parseFloat(event.toString())) } renderThumb={ (props, state) =>
{ state.valueNow }
} /> - updateHeight(parseFloat(event.target.value)) } /> + setHeight(parseFloat(event.target.value)) } />