baseweb
baseweb copied to clipboard
Slider crashes entire page on large min/max values
Current Behavior
The page freezes and then crashes when the following values are entered:
https://baseweb.design/components/slider/
min: -Infinity, -1000000000
max: 1000000000, Infinity
Expected Behavior
The page should not crash and should output an error instead.
Your Environment
| Tech | Version |
|---|---|
| Base UI | v10.3.0 |
| React | v17.0.2 |
| browser | Chrome 95.0.4638.69 |
- [x] I have searched the issues of this repository and believe that this is not a duplicate.
Can you elaborate on your use case that requires this amount of values?
Hi @williamernest , these values are not used but resulted in a crash that was difficult to debug as values were being initialised to Infinity for an audio duration slider. It would be helpful to throw an error for such cases as a preventive measure.
Note that you don't need to set any value to infinity, just a sufficiently large range. Additionally, a hang is virtually guaranteed with a few thousand values, a small enough step value, and marks enabled. Seems like the Slider component could use some guardrails.