material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Header selection checkbox should reflect filtered data

Open chris-jalon opened this issue 5 years ago • 1 comments

When filtering a table, the header selection checkbox does not reflect filtered data.

Sandbox to reproduce: https://codesandbox.io/s/material-table-header-selection-checkbox-filter-example-v6pw7

To reproduce:

  1. View a table with many selectable rows
  2. Select all rows using the header checkbox
  3. Apply a filter so that only some rows are displayed (in the example, type 24 in the search box)
  4. See that header selection checkbox is not checked even though all row checkboxes are.

Expected behavior: Header selection checkbox should reflect filtered items (including those on other pages, if paging enabled)

The logic here is compares the count of filtered rows to all rows of data: https://github.com/mbrn/material-table/blob/b7474ca0f5497f04ff3a3d50e709d86de7c639b0/src/components/m-table-header.js#L259-L266 so the checkbox remains unchecked.

chris-jalon avatar Jul 29 '21 18:07 chris-jalon

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

stale[bot] avatar Oct 27 '21 23:10 stale[bot]