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

Table: Fix selection loss when applying filters and using Items property #8538

Merged
merged 10 commits into from
Apr 2, 2024

Conversation

ralvarezing
Copy link
Contributor

@ralvarezing ralvarezing commented Mar 30, 2024

Description

The multiselect were being cleared when a filter or page changes using Items.
This was caused because when evaluating if the disposed table item is in the table, was evaluating against the FilteredItems instead of Items.
Because of this, when a filter was applied, all items that didn't match the filter, were consider NOT to be in the table, and being removed from the SelectedItems.

A similar bug was fixed in #7914, but when the data source is ServerData.

fixes #7535

How Has This Been Tested?

Added test TableMultiSelectItemsTest1_PageChange
Added test TableMultiSelectItemsTest1_FilterChange

Types 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)

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 the bug Something does not work as intended/expected label Mar 30, 2024
Copy link

codecov bot commented Mar 31, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 89.54%. Comparing base (851eba0) to head (ed79335).

Files Patch % Lines
src/MudBlazor/Components/Table/MudTable.razor.cs 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8538      +/-   ##
==========================================
+ Coverage   89.50%   89.54%   +0.04%     
==========================================
  Files         411      411              
  Lines       11832    11832              
  Branches     2349     2349              
==========================================
+ Hits        10590    10595       +5     
+ Misses        718      715       -3     
+ Partials      524      522       -2     

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

@ralvarezing ralvarezing marked this pull request as ready for review March 31, 2024 02:26
@ScarletKuro ScarletKuro requested a review from henon April 1, 2024 21:42
@ScarletKuro
Copy link
Member

@ralvarezing can you rebase / merge against latest changes? The datepicker tests were fixed.

@ralvarezing
Copy link
Contributor Author

@ralvarezing can you rebase / merge against latest changes? The datepicker tests were fixed.

Perfect! done

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

@henon henon changed the title Table: Multiselect clearing when applying filters using Items property Table: Fix selection loss when applying filters and using Items property Apr 2, 2024
@henon henon merged commit d39524e into MudBlazor:dev Apr 2, 2024
3 of 4 checks passed
@henon
Copy link
Collaborator

henon commented Apr 2, 2024

Thanks @ralvarezing

danielchalmers pushed a commit to danielchalmers/MudBlazor that referenced this pull request Apr 2, 2024
biegehydra pushed a commit to biegehydra/MudBlazor that referenced this pull request Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MudTable: Filter removes items from current MultiSelection
3 participants