Change value in table fields

* Input table fields need to be able to be empty
* Slider table fields should default to 0 if value isn't provided
This commit is contained in:
Justin Edmund 2023-03-20 10:02:32 -07:00
parent 8ab65a98e9
commit b0a4bf8fc4
2 changed files with 4 additions and 2 deletions

View file

@ -8,6 +8,7 @@ interface Props {
name: string
label: string
description?: string
placeholder?: string
value?: number
className?: string
imageAlt?: string
@ -42,8 +43,9 @@ const InputTableField = (props: Props) => {
>
<Input
className="Bound"
placeholder={props.placeholder}
type="number"
value={`${value}`}
value={value ? `${value}` : ''}
step={1}
onChange={onInputChange}
/>

View file

@ -58,7 +58,7 @@ const SliderTableField = (props: Props) => {
min={props.min}
max={props.max}
step={props.step}
value={[value]}
value={[value ? value : 0]}
onValueChange={handleValueChange}
onValueCommit={handleValueCommit}
/>