kobaltedev / kobalte

A UI toolkit for building accessible web apps and design systems with SolidJS.
https://kobalte.dev
MIT License
1.23k stars 63 forks source link

`NumberField` sometimes incorrectly jumps to next integer when `step` property is a decimal #451

Closed jamielaw-jellyfish closed 3 weeks ago

jamielaw-jellyfish commented 1 month ago

In this Solid Playground snippet, I have set up a number field based on the Controlled Value example from the docs, with a starting value of 40, but with a step size of 0.1.

To Reproduce

  1. Click the increment button - the value changes to 40.1 (correct)
  2. Click the increment button again - the values changes to 41 (incorrect, expected 40.2)
  3. Click the decrement button - the value changes to 40.9 (correct)
  4. Click the decrement button again - the values changes to 40 (incorrect, expected 40.8)

I have observed the same issue when using the up/down arrows as well.

Tested on Chrome 126, Firefox 128 and Safari 17 on Mac