Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accordion/PanelMenu: (Tailwind) animation issues #5540

Closed
sdwillbrand opened this issue Dec 6, 2023 · 12 comments · Fixed by #6167
Closed

Accordion/PanelMenu: (Tailwind) animation issues #5540

sdwillbrand opened this issue Dec 6, 2023 · 12 comments · Fixed by #6167
Assignees
Labels
Component: Tailwind Tailwind specific issue Type: Performance Issue is performance or optimization related
Milestone

Comments

@sdwillbrand
Copy link
Contributor

sdwillbrand commented Dec 6, 2023

Describe the bug

When closing the AccordionTab the transition delays a bit.

Reproducer

https://codesandbox.io/p/sandbox/primereact-bug-accordion-collapse-delayed-9yrj8d

PrimeReact version

10.3.0

React version

18.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. Create Accordion with AccordionTab
  2. Toggle AccordionTab

Expected behavior

Smooth transitioning when closing the AccordionTab

@sdwillbrand sdwillbrand added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 6, 2023
@melloware melloware added Type: Performance Issue is performance or optimization related Component: Tailwind Tailwind specific issue and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 6, 2023
@melloware
Copy link
Member

I assume this is unstyled or tailwind related because the showcase transitions fine? https://primereact.org/accordion/#basic

@sdwillbrand
Copy link
Contributor Author

We suspect the same.

@melloware
Copy link
Member

@sdwillbrand
Copy link
Contributor Author

Yeah that looks good. We found an edge case, where a small content causes the delay. For instance here, the first and second tab do have a delay, but the third with the larger content does not have a delay.

Does the transition starts at a fixed height?

@melloware
Copy link
Member

melloware commented Dec 6, 2023

All I see in the tailwind stuff is this?

 "p-5 transition duration-200 ease-in-out rounded-t-md font-bold transition-shadow duration-200", // Padding and transition

@sdwillbrand
Copy link
Contributor Author

There is also a transition attribute:

 transition: TRANSITIONS.toggleable

I think PrimeReact adds classes to the AccordionTab when the Tab is toggled. If you inspect the AccordionTab while toggling you see for a short moment the classes, max-h-40 !max-h-40 overflow-hidden transition-all duration-500 ease-in-out. I am not sure if that causes a small AccordionContent to be collapsed by a tiny delay.

@melloware
Copy link
Member

Yep you are right:

    toggleable: {
        timeout: 500,
        classNames: {
            enter: 'max-h-0',
            enterActive: '!max-h-40 overflow-hidden transition-all duration-500 ease-in-out',
            exit: 'max-h-40',
            exitActive: '!max-h-0 overflow-hidden transition-all duration-500 ease-in'
        }
    },

@melloware
Copy link
Member

@countersoda i want to test this again after the next release to see if it is the same or worse. I can't quite figure out why its delayed.

@sdwillbrand
Copy link
Contributor Author

@melloware Appreciated

@melloware
Copy link
Member

@countersoda 10.3.0 is out and looks like the same behavior. I can't explain it!

@Tarik1700
Copy link
Contributor

Same issue but with PanelMenu component when there are over 3 items inside the dropdown.
@melloware thanks for the redirect! any additional info on status for this since i see its been open since december ?

@melloware
Copy link
Member

@Tarik1700 yeah i took a look at it but i am not that familiar with Tailwind. So PR is welcome if not if you need immediate help I suggets you check out PrimeReact PRO support.

@melloware melloware changed the title Accordion (Tailwind): AccordionTabs collapse delayed Accordion/PanelMenu: (Tailwind) animation issues Mar 15, 2024
@melloware melloware added this to the 10.5.2 milestone Mar 16, 2024
nitrogenous added a commit that referenced this issue Mar 18, 2024
Issue - #5540 -  Bugfix: fixed animations not working correctly on TRANSITION.toggleable with tailwind preset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Tailwind Tailwind specific issue Type: Performance Issue is performance or optimization related
Projects
None yet
3 participants