1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +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`}
/>