Skip to content

MudCollapse: Rework animation#10056

Merged
ScarletKuro merged 5 commits intoMudBlazor:devfrom
danielchalmers:collapse-animation
Oct 20, 2024
Merged

MudCollapse: Rework animation#10056
ScarletKuro merged 5 commits intoMudBlazor:devfrom
danielchalmers:collapse-animation

Conversation

@danielchalmers
Copy link
Member

@danielchalmers danielchalmers commented Oct 19, 2024

Description

Fixes #8939 by reworking the animation entirely to use CSS transitions on a grid display as opposed to calculating the height through JavaScript. This should be more performant and stable.

Impacts other components like the Expansion Panels, Tree View, Nav Menu. I'd like it if someone with more experience with those components can try the new transition effect locally.
 

How Has This Been Tested?

visually

Type of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation (fix or improvement to the website or code docs)

Before: #8939 (comment)

After:

video6.mp4

Animation is now a static 300ms which is between 50% slower and 333% faster, depending on how tall the content was before.

CollapseState, _state, AnimationEndAsync are now private but I don't believe I made any other breaking changes aside from rewriting the CSS obviously (but the CSS classes themselves are still the same).

Checklist

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

@github-actions github-actions bot added enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Oct 19, 2024
@codecov
Copy link

codecov bot commented Oct 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.04%. Comparing base (6ac51c8) to head (c11de65).
Report is 7 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10056      +/-   ##
==========================================
- Coverage   91.10%   91.04%   -0.06%     
==========================================
  Files         410      410              
  Lines       12476    12467       -9     
  Branches     2421     2420       -1     
==========================================
- Hits        11366    11351      -15     
- Misses        565      572       +7     
+ Partials      545      544       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ScarletKuro ScarletKuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I absolutely love this.

@ScarletKuro ScarletKuro requested a review from henon October 19, 2024 22:07
@ScarletKuro
Copy link
Member

cc @henon @jperson2000 @igotinfected if anyone wants to test anything visually, feel free
Otherwise want to get this asap :)

Copy link
Contributor

@henon henon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome how much code could be removed by this change!

@ScarletKuro ScarletKuro added breaking change This change will require consumer code updates v8 and removed PR: needs review labels Oct 20, 2024
@ScarletKuro
Copy link
Member

Added to the v8 migration guide at #9953

@ScarletKuro ScarletKuro merged commit af7d684 into MudBlazor:dev Oct 20, 2024
@oscarsjocrona
Copy link

Great! Thank you

LLauter pushed a commit to cannellamedia/MudBlazor that referenced this pull request Dec 16, 2024
@bsallesp
Copy link

Hi folks, migrating from 7.16 to 8.3, my MudCollapse components didn't expand/collapse anymore. Any thoughts?

@henon
Copy link
Contributor

henon commented Mar 21, 2025

@bsallesp See if it works in an incognito tab. if so this is a browser cache issue.

@Anu6is
Copy link
Contributor

Anu6is commented Mar 21, 2025

It works as expected in the docs - https://mudblazor.com/components/collapse#api
try clearing your cache or reproduce a TryMud example where it does not work

@bsallesp
Copy link

on it

@bsallesp
Copy link

You guys saved the day. Let me know If a can help with something else. I'm open for participating for new communities. See ya!

@henon
Copy link
Contributor

henon commented Mar 21, 2025

Let me know If a can help with something else. I'm open for participating for new communities.

We appreciate any help we can get. Whenever you see something that needs improving, even if it's just small corrections/improvements in the docs, just open a PR for it. Every little bit helps!

@bsallesp
Copy link

Noy urgent, but, I'm trying to clean my browser cache (brave), specially things from Blazor 7. I accept suggestions.

In meanwhile, using anonymous tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change This change will require consumer code updates enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MudTreeViewItem: annoyingly slow opening time when expand is triggered via check box

6 participants