qri-io / desktop

Qri Desktop
https://qri.io/desktop
GNU General Public License v3.0
67 stars 14 forks source link

Selected dataset count gets out of sync when removing datasets from Collection view #647

Open uhLeeshUh opened 4 years ago

uhLeeshUh commented 4 years ago

What version of qri are you using (qri version)?

v0.9.13-dev

What version of Qri Desktop are you using?

0.4.6-dev

Issue

What did you do?

(note, the same issue happens without bulk remove. If you select a dataset before removing it via the hamburger menu, it persists in table selection state)

What happened?

The internal selected state of the Collection table jumped from the correct number of selected datasets to, after selecting another dataset, the incorrect number (which includes the deleted datasets)

What did you expect to happen?

That those deleted datasets would not be considered selected anymore

Do you have a suggested fix?

The problem is likely that there is a discrepancy between internal component state of the DatasetList component and the ReactDataTable component. This can be visible by logging the value of selectedRows in handleSelectedRowsChange of the DatasetList component