Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
293 stars 75 forks source link

Calcite slider with snap=true and step=1 can present floating point, non-integer values #9684

Closed RSantosGIS closed 2 months ago

RSantosGIS commented 4 months ago

Check existing issues

Actual Behavior

The calcite slider allows users to select values that are very close to, but not quite, a round integer value. See below: image

Expected Behavior

When snap=true and step=1 (or any other integer value), the slider should only change to exactly integer values (no decimal place).

Reproduction Sample

Documentation (ArcGIS Knowledge Studio / Teams chat)

Reproduction Steps

Please see the conversation in teams chat

@benelan indicated he was already aware of this issue since Slider isn't using a util that handles precision issues.

Reproduction Version

2.8

Relevant Info

No response

Regression?

No response

Priority impact

impact - p2 - want for an upcoming milestone

Impact

Everything works, but it looks unprofessional in our app. For applications where exact integer values are required, it makes the slider component unusable.

Calcite package

Esri team

ArcGIS Knowledge

geospatialem commented 4 months ago

@RSantosGIS Would you be able to put together a sample for us above to troubleshoot? We're trying to determine if this is React-specific.

RSantosGIS commented 4 months ago

I tried to create something in the sandbox but wasn't able to reproduce, and since Ben indicated that you guys already knew about a problem with rounding numbers I didn't pursue it further. If you need me to, I can make an issue to try to spend some more time on this for the repro case

benelan commented 2 months ago

Picking this up now, here is a repro sample: https://codepen.io/benelan/pen/jOjxbRg

github-actions[bot] commented 2 months ago

Installed and assigned for verification.

DitwanP commented 2 months ago

šŸ” Verified on 2.12.0-next.34 https://codepen.io/Ditwan-Price/pen/gONjYNP?editors=1010