1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 05:45:22 +02:00

fix(ui): parse slider value correctly [EE-6225] (#10484)

This commit is contained in:
Chaim Lev-Ari 2023-11-14 13:17:25 +02:00 committed by GitHub
parent 99b39da03d
commit 95d96e1164
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions

View file

@ -39,7 +39,9 @@ export function SliderWithInput({
min="0"
max={max}
value={value}
onChange={(e) => onChange(e.target.valueAsNumber)}
onChange={({ target: { valueAsNumber: value } }) =>
onChange(Number.isNaN(value) ? 0 : value)
}
className="w-32"
data-cy={`${dataCy}Input`}
/>

View file

@ -62,7 +62,7 @@ export function ResourceQuotaFormSection({
className={typeof errors === 'string' ? 'visible' : 'invisible'}
>
{/* 'error' keeps the formerror the exact same height while hidden so there is no layout shift */}
{errors || 'error'}
{typeof errors === 'string' ? errors : 'error'}
</FormError>
<FormControl
className="flex flex-row"