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
14.82k stars 717 forks source link

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

Open jinwoo0103 opened 1 month ago

jinwoo0103 commented 1 month 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 1 month 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 days ago

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