desktop icon indicating copy to clipboard operation
desktop copied to clipboard

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

Open uhLeeshUh opened this issue 5 years ago • 0 comments

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?

  • Add 3 local datasets
  • Navigate to Collection view
  • Select 2 of the datasets via the checkbox
  • Click "Remove" button and select "Remove" on the modal
  • UI appears to have worked successfully
  • Now select the final remaining dataset via checkbox and the copy reads "3 selected"

(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

uhLeeshUh avatar Oct 09 '20 15:10 uhLeeshUh