Skip to content

Slider breaks if rendered while hidden #1992

@dorianim

Description

@dorianim

Describe the bug

When a slider is inside an accordion which is closed when it is rendered, the calculation of the Thumb position does not work correctly, because getBoundingClientRect returns all zeroes.

When the page loads, slider 1 is open, 2 and 3 are closed:
Image
-> All three are rendered, but only slider 1 is visible

When Slider 2 or 3 are opened, they don't render correctly:
Image

Reproduction

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

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions