cyhnkckali / vue3-color-picker

The Unlicense
33 stars 9 forks source link

Change number input behaviour #17

Closed kaskenov closed 3 months ago

kaskenov commented 3 months ago

Current behaviour: When user clears the field we have a warning

Screenshot 2024-04-04 at 22 01 02

and after user unfocus this field is stay empty. Also when user tries to type 101 in field that max value is 100 he won't be able to do that, so 10 will be the value in that case.

Expected behaviour: As an example Figma behaviour. Save value only on Enter keydown or unfocus as it already works in hex input. Empty field save as previous value. If value > max save as max.

Benefits: Prevent warnings. Make behaviour more clear. Less fn calls = faster work. 🚀