Skip to content

Setting slider max to Infinity can crash the browser or throw an error #1663

@hahn-kev

Description

@hahn-kev

Describe the bug

If you set <Slider.Root max={Infinity}/> either directly, or though error, in Firefox the tab will hang, and Chrome will report an error with max array size, which is how I was able to track down the issue. Ideally bits would throw an error to avoid crashing the tab.

In my case I was creating an audio player, and the audio element set duration as Infinity.

Reproduction

https://stackblitz.com/edit/xvfvdpk8?file=src%2Froutes%2F%2Bpage.svelte

Logs

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i9-12900H
    Memory: 7.22 GB / 31.69 GB
  Binaries:
    Node: 20.18.1 - ~\AppData\Local\nvs\default\node.EXE
    npm: 10.8.2 - ~\AppData\Local\nvs\default\npm.CMD
    pnpm: 10.12.3 - ~\AppData\Local\nvs\default\pnpm.CMD
    bun: 1.2.2 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (137.0.3296.93)
    Internet Explorer: 11.0.26100.1882

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions