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

[table] bug, onRowSelection get called when clicking places outside table component

Open mauvew opened this issue 10 years ago • 2 comments

Problem description

This should be a bug. After selected a row in Table, clicking nearly wherever in the screen, the selected row get unselected. I think it is due to onRowSelection get called with empty array as the function parameter.

This seems a critical issue for the behaviour of a selectable table

Steps to reproduce

Fairly strightforward. Go to doc website.

  1. select a row in the table image
  2. click wherever the page image
  3. the selected row get unselected

Versions

  • Material-UI: all versions
  • React:
  • Browser: Chrome 51

mauvew avatar Jul 03 '16 10:07 mauvew

If you don't want that clicking outside the table causes deselection you can use/set deselectOnClickaway prop on TableBody. YOu have it documented on Material-UI website under TableBody Properties.

mario-jerkovic avatar Jul 03 '16 18:07 mario-jerkovic

ah, thank you very much @mario-jerkovic , I didn't notice it, will close this issue :smile: :sweat_smile:

mauvew avatar Jul 03 '16 20:07 mauvew