radix-ui / primitives

Radix Primitives is an open-source UI component library for building high-quality, accessible design systems and web apps. Maintained by @workos.
https://radix-ui.com/primitives
MIT License
15.92k stars 832 forks source link

[Accordion] layout shift with initial open items. #2891

Open jinwoo0103 opened 6 months ago

jinwoo0103 commented 6 months ago

Bug report

Current Behavior

Can check layout shift when click (Command + Shift + R) on Accordion documentation example

https://github.com/radix-ui/primitives/assets/48249867/bcd35aaa-fcaf-4baa-806f-b520b8f8d962

Expected behavior

It should be initially open when defaultValue / value has some open accordion items

Reproducible example

Can check layout shift when click (Command + Shift + R) on Accordion documentation example

Suggested solution

Since accordion is built on collapsible (might be right?), collapsible's default open determination should consider defaultValue / value, not just false.

Additional context

It seems icon is displaying correctly...? or maybe it is too fast...

Your environment

Since it can be checked on chrome, I attach my mac and chrome info only

thexpand commented 6 months ago

It's not Chrome-specific, it's on Safari as well.

M3 Max, macOS 14.3.1 Safari Version 17.3.1 (19617.2.4.11.12)

alexpuertasr commented 5 months ago

How is this going? We have the same issue in our nav that is using this component

peter-wd-1 commented 3 months ago

We're also having the same issue. We had to switch first element in view with custom component.

hsavit1 commented 2 months ago

anyone have luck with this??