gregnb / gregnb/mui-datatables

selectedRows state is not persisted on render

Open
#1,313 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

State for all table is persisted except the selected rows. This is very inconvenient when you want users to select some of the rows in order to do something with them en-masse.

USE CASE:

We have a list of reports that a user has created. The expected functionality is that the user can select a subset of those reports and do something with them, like adding them to a sub-list or sharing them with another user.

Currently, doing anything that rerenders the app state will unselect the selectedRows, and wont allow simple use of the selectedRows dataIndex to do things in a database.

## Expected Behavior

Checkboxes state should be persisted across renders.

## Current Behavior

Checkboxes state is not persisted.

## Steps to Reproduce (for bugs)

1.Check a box
2.Rerender the table

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is identified in the issue. Start by reproducing the problem in the table: check a box, rerender the table, and observe whether the selection remains. Done means checkbox state and selectedRows persist across renders.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.