material-ui
material-ui copied to clipboard
[table] bug, onRowSelection get called when clicking places outside table component
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.
- select a row in the table

- click wherever the page

- the selected row get unselected
Versions
- Material-UI: all versions
- React:
- Browser: Chrome 51
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.
ah, thank you very much @mario-jerkovic , I didn't notice it, will close this issue :smile: :sweat_smile: