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

[MudDataGrid] Select All Header Checkbox Bug And Inconsistent Behavior #10563

Open
3 of 4 tasks
Eddie-Hartman opened this issue Jan 6, 2025 · 1 comment
Open
3 of 4 tasks

Comments

@Eddie-Hartman
Copy link
Contributor

Things to check

  • I have searched the existing issues for this bug
  • To rule out a caching problem I made sure the bug also happens in an incognito tab

Bug type

Component

Component name

MudDataGrid

What happened?

I've grouped these together because they kind of play off of each other. If they need separated to two issues they easily can be.

  1. The Bug:
    1. In the reproduction link below, hit run and then select a single element, for example Lithium.
    2. Then, filter by the sign of another element so that only one shows, for example filter by Sign contains "Hg".
    3. Notice the Select checkbox in the header is checked, indicating everything filtered is checked, but it's not.
    4. This is happening because the HeaderContext IsAllSelected property is just checking a count instead of equality here (Items is filtered items in this case)
  2. The Inconsistency:
    1. Fix DataGrid Select-All behaviour when filtered #7167 totally makes sense. However, I wouldn't expect it to unselect items NOT in the filter. If I'm filtering, I'd expect that select all to represent and ONLY affect the state of items in the filter.
    2. Again with the same reproduction link (start with no items selected), filter name by contains "H".
    3. Select all items with the header checkbox.
    4. Change the filter to filter by contains "B".
    5. Notice the partial checkbox state. (Which usually indicates some items are selected, but not all. In this case, none of the filtered items are selected.)
    6. Click the box to select all (expected this to ADD filtered items to selected list).
    7. Remove the filter and notice the items containing "H" are no longer selected.
    8. For sake of thoroughness, if I were to click the select all button again before removing the filter in step 7, I'd expect JUST the elements that contain "B" in their names to be unselected and not ALL items. The select all box would be empty (an not have the partial indicator).

Expected behavior

Described above.

Reproduction link

https://try.mudblazor.com/snippet/vVfdb9s2EH_3P9ED0QcZSOTuA3tYbMONl7QemsSrg-5hGAJaYmyuFOmRVBI38P--44cky3HSeUDnB5kij_d9vzvd3FxQLlNNvyj9alQaLhcwWxvLivSS2fS9tav0V6NkJ55dlP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GX4LyRMVuy33a2ZLLSN2pttGuB96mD1PHug2tSV-tIBbj_pwXC0WQs2pEGugmVbGQBFnFcgCmAFW-BLsEp3uTOdyVdoXLHd-R7u3xpgXjA--TyfmshTiSv--5Jb50khake3u9Ylr5CedFr_QlFIHmzgxmjaXIwj_Y1WssEpwYEyvdM4lFZOFRHgZU8MOkOQD8j9Iek0eq3a-gcemAfoX38k25Bk9_pWMuOsHgDpjYoCV9WMhqDumsfEwoGYtM7im5jMiy0SiIlTgFJS_dftJdyfEWxVN7ynfnrPTd8yea1W4ud1f7rfqfZiQezanK95bxXHSjy4kluWmU-V0KFr_dqdwYG9G4qRql9WWbypv9cI0kEPxbVfpCiAn0mDzT94cwWvir6IVFasjmMgce-4AHh2LFPf9xuYInFS3Hz9QXF_xHyf-MfMTJTpMp_Uy8Rzc5N3dNPa5Z8uq7Tn-G5nWiPj29jW27fv2SN5Ts5yxJh-Au9ND7NnH9r9oHwRvab55FZVKM_Oq9TGKA1L8ODSY3hJZZCedFkUjrxJAHTnWm2srxiHf175eYyMt5xinMGpUZbbjnEgSO6UfXeERFsyegHGPzS4lR79V4PIyZeTpp8KvsgzQtUNXE_7hvFEN2o5hQkyB7Yh0_3xGqkP4l6XmCv_RkX7Kf5Fy4kGHx-kjsxpD95ym8UoNhVGdaxWwNnluBI34ijDuNN9g4310dm5I08Y3VWr9Aw

Reproduction steps

Described above.

Relevant log output

No response

Version (bug)

7.15.0

Version (working)

No response

What browsers are you seeing the problem on?

Chrome

On which operating systems are you experiencing the issue?

Windows

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Eddie-Hartman
Copy link
Contributor Author

FWIW I could do a PR to fix one or both, but wanted to see how the discussion goes first before going in and applying fixes since as described above, they somewhat tie into each other.

I'm also currently still running 6.X for the product more immediately affected by this and it won't be getting upgraded so I currently plan on hiding the header checkbox and implementing my own bulk selects and deselects. Meaning even if we agree with everything I put in here and thumbs up the changes, I'll not get around to making the PR for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant