mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 11:23:50 +00:00
Params Input Placeholders (#627)
* add `placeholder?: string;` to `StringField` & `NumberField` * add `placeholder` to inputs * move values from `defaultValue` to `placeholder`
This commit is contained in:
@@ -42,24 +42,31 @@ export default function ParamInput(props: EditFormInputProps) {
|
||||
}
|
||||
|
||||
if (type === 'number') {
|
||||
const { prefix } = paramField;
|
||||
const { prefix, placeholder } = paramField;
|
||||
const defaultNumberValue = searchParams.get(id) ?? defaultValue;
|
||||
|
||||
return (
|
||||
<InputGroup variant='ontime-filled'>
|
||||
{prefix && <InputLeftElement pointerEvents='none'>{prefix}</InputLeftElement>}
|
||||
<Input type='number' step='any' variant='ontime-filled' name={id} defaultValue={defaultNumberValue} />
|
||||
<Input
|
||||
type='number'
|
||||
step='any'
|
||||
variant='ontime-filled'
|
||||
name={id}
|
||||
defaultValue={defaultNumberValue}
|
||||
placeholder={placeholder}
|
||||
/>
|
||||
</InputGroup>
|
||||
);
|
||||
}
|
||||
|
||||
const defaultStringValue = searchParams.get(id) ?? defaultValue;
|
||||
const { prefix } = paramField;
|
||||
const { prefix, placeholder } = paramField;
|
||||
|
||||
return (
|
||||
<InputGroup variant='ontime-filled'>
|
||||
{prefix && <InputLeftElement pointerEvents='none'>{prefix}</InputLeftElement>}
|
||||
<Input name={id} defaultValue={defaultStringValue} />
|
||||
<Input name={id} defaultValue={defaultStringValue} placeholder={placeholder} />
|
||||
</InputGroup>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user