Transform default number field value

- Navidrome allows for "string" number query values which will not work with the numberinput
This commit is contained in:
jeffvli 2023-01-08 01:07:17 -08:00
parent b82a5eda78
commit d6035a5f97

View file

@ -48,6 +48,7 @@ const QueryValueInput = ({ onChange, type, ...props }: any) => {
size="sm"
onChange={onChange}
{...props}
defaultValue={props.defaultValue && Number(props.defaultValue)}
/>
);
case 'date':
@ -64,7 +65,7 @@ const QueryValueInput = ({ onChange, type, ...props }: any) => {
<>
<NumberInput
{...props}
defaultValue={props.defaultValue?.[0]}
defaultValue={props.defaultValue && Number(props.defaultValue?.[0])}
maxWidth={81}
width="10%"
onChange={(e) => {
@ -75,7 +76,7 @@ const QueryValueInput = ({ onChange, type, ...props }: any) => {
/>
<NumberInput
{...props}
defaultValue={props.defaultValue?.[1]}
defaultValue={props.defaultValue && Number(props.defaultValue?.[1])}
maxWidth={81}
width="10%"
onChange={(e) => {