baseweb icon indicating copy to clipboard operation
baseweb copied to clipboard

Slider crashes entire page on large min/max values

Open Nanosync opened this issue 4 years ago • 3 comments

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.

Nanosync avatar Nov 03 '21 07:11 Nanosync

Can you elaborate on your use case that requires this amount of values?

williamernest avatar Nov 03 '21 18:11 williamernest

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.

Nanosync avatar Nov 05 '21 02:11 Nanosync

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.

bsplosion avatar Mar 16 '22 00:03 bsplosion