[Bug]: Transition applied on content instead of Disclosure panel
See original GitHub issueWhat package within Headless UI are you using?
What version of that package are you using?
v1.4.2
What browser are you using?
Chrome (Tested on Edge and Firefox)
Reproduction URL
https://codesandbox.io/s/headlessui-disclosure-transition-issue-6ogxj?file=/src/App.tsx
Describe your issue
When i use Transition component on Disclosure Panel, the transition is applied on content of panel instead of panel himself. I tried to use only documentation exemple, outside my project, but the exemple on documentation was already broken 🤔
(Note: I have volontarily increase the duration of transition to expect the beahavor)
(Note 2: I tried to use unmount
prop already, but seems to component was systematicaly unmounted regardless this prop)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:9
Top Results From Across the Web
Disclosure - Headless UI
To animate the opening/closing of the menu panel, use the provided Transition component. All you need to do is wrap the Disclosure.Panel in...
Read more >Disclosure Widgets - Adrian Roselli
When the content is visible, the element with role button has aria-expanded set ... by making the disclosed panels for each scroll instead....
Read more >Popovers - Presentation - Human Interface Guidelines - Design
A popover is a transient view that appears above other content onscreen when people click or tap a control or interactive area.
Read more >Create top-down slide animation using `Transition` from ...
This is how I created a similar animation for a disclosure panel: <Transition enter="transition ease duration-500 transform" ...
Read more >National Bioengineered Food Disclosure Standard
The final rule adopts the same definition of “food” as used in the ... may choose to make a BE disclosure rather than...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Another workaround is to use the
Disclosure
component but manage its state manually usingstatic
, and then transition theheight
(ormax-height
to workaround the transition toauto
):@RobinMalfait What about the behaviour I described in my comment? the sandbox example you provided also shows it. When you expand the Disclosure, the panel appears instantly, or at least everything shifts down instantly and the contents emerge from 0 opacity gradually (based on transition time function and duration). This produces ugly jump of a page content below the disclosure which the Transition meant to avoid at the first place.