Skip to content

MudDataGrid: properly clear the filter values#9801

Merged
ScarletKuro merged 4 commits intoMudBlazor:devfrom
0xced:clear-filters
Sep 23, 2024
Merged

MudDataGrid: properly clear the filter values#9801
ScarletKuro merged 4 commits intoMudBlazor:devfrom
0xced:clear-filters

Conversation

@0xced
Copy link
Contributor

@0xced 0xced commented Sep 12, 2024

Description

Clicking the clear filter buttons or calling the dataGrid.ClearFiltersAsync() method would not actually clear the filter values.

Fixes #6951
Fixes #8318
Closes #9532

How Has This Been Tested?

Two unit tests have been added.

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 (❌ filter values don't clear):

Before.mp4

After (✅ filter values are properly cleared):

After.mp4

Checklist

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

@codecov
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.82%. Comparing base (28bc599) to head (3099416).
Report is 1103 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9801      +/-   ##
==========================================
+ Coverage   89.82%   90.82%   +0.99%     
==========================================
  Files         412      406       -6     
  Lines       11878    12825     +947     
  Branches     2364     2485     +121     
==========================================
+ Hits        10670    11648     +978     
+ Misses        681      625      -56     
- Partials      527      552      +25     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

@0xced 0xced changed the title MudDataGrid: clear the filter values when using the ColumnFilterRow mode MudDataGrid: properly clear the filter values Sep 13, 2024
@ScarletKuro
Copy link
Member

Will merge this if @tjscience won't reply within a week on this PR

@ScarletKuro ScarletKuro self-assigned this Sep 19, 2024
Copy link
Contributor

@tjscience tjscience left a comment

Choose a reason for hiding this comment

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

This looks good to me, although the line with Debug.Assert(index != 1); seems unnecessary.

@0xced
Copy link
Contributor Author

0xced commented Sep 23, 2024

Removed in 3099416.

@ScarletKuro ScarletKuro merged commit 101f849 into MudBlazor:dev Sep 23, 2024
@0xced 0xced deleted the clear-filters branch September 23, 2024 10:57
@ScarletKuro
Copy link
Member

The RemoveFilterAsync is throwing exception:
image

@ScarletKuro ScarletKuro mentioned this pull request Oct 15, 2024
4 tasks
ScarletKuro added a commit to ScarletKuro/MudBlazor that referenced this pull request Oct 16, 2024
ScarletKuro added a commit that referenced this pull request Oct 17, 2024
# Conflicts:
#	src/MudBlazor.UnitTests/Components/DataGridTests.cs
@polaarbear
Copy link

This appears to still exist if you are running on .NET 8 in pure server mode and using ServerData to populate?

The clear button does force the grid to refresh, but the filters do not get cleared.

LLauter pushed a commit to cannellamedia/MudBlazor that referenced this pull request Dec 16, 2024
@danielchalmers danielchalmers added the regression Previously worked and now doesn't label Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended regression Previously worked and now doesn't

Projects

None yet

5 participants