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

Move className overwrite of AccordionContent to the children component #1670

Merged
merged 4 commits into from
Nov 12, 2023

Conversation

shug0
Copy link
Contributor

@shug0 shug0 commented Oct 4, 2023

In order to have a smooth opening of the accordion, moving the AccordionContent className overwrite to the children wrapper component allow Radix to calculate correctly the animation and execute a smooth animation in case of className on the AccordionContent component.

Possibly related to #944

In order to have a smooth opening of the accordion, moving the AccordionContent className overwrite to the children wrapper component allow Radix to calculate correctly the animation and execute a smooth animation in case of className on the  AccordionContent.

Possibly related to shadcn-ui#944
@vercel
Copy link

vercel bot commented Oct 4, 2023

@shug0 is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@shug0
Copy link
Contributor Author

shug0 commented Oct 4, 2023

Demo Code

      <Accordion type="single" collapsible>
        <AccordionItem value="platform">
          <AccordionTrigger className="px-6 font-light">
            Platform
          </AccordionTrigger>
          <AccordionContent className="px-6 py-4 bg-gray-50 border-t-1 border-gray-200">
            <PlatformFilter currentFilters={currentFilters} />
          </AccordionContent>
        </AccordionItem>

Laggy demo (current implementation)

laggy.mp4

Smooth demo (suggested changes)

smooth.mp4

@shadcn
Copy link
Collaborator

shadcn commented Oct 20, 2023

Agreed.

@shadcn shadcn added bug Something isn't working component: accordion area: roadmap This looks great. We'll add it to the roadmap, review and merge. labels Oct 20, 2023
@vercel
Copy link

vercel bot commented Oct 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 12, 2023 10:57am

@shadcn
Copy link
Collaborator

shadcn commented Nov 12, 2023

Fixes #944

@kodiakhq kodiakhq bot merged commit e6e9a67 into shadcn-ui:main Nov 12, 2023
kjxbyz pushed a commit to muse-ui/muse-ui that referenced this pull request Jun 7, 2024
shadcn-ui#1670)

In order to have a smooth opening of the accordion, moving the `AccordionContent` `className` overwrite to the children wrapper component allow Radix to calculate correctly the animation and execute a smooth animation in case of `className` on the `AccordionContent` component.

Possibly related to shadcn-ui#944
artabr pushed a commit to artabr/shadcn-ui that referenced this pull request Dec 15, 2024
shadcn-ui#1670)

In order to have a smooth opening of the accordion, moving the `AccordionContent` `className` overwrite to the children wrapper component allow Radix to calculate correctly the animation and execute a smooth animation in case of `className` on the `AccordionContent` component.

Possibly related to shadcn-ui#944
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: roadmap This looks great. We'll add it to the roadmap, review and merge. automerge bug Something isn't working component: accordion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants