Material-ui: [table] bug, onRowSelection get called when clicking places outside table component

Created on 3 Jul 2016  路  2Comments  路  Source: mui-org/material-ui

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

Most helpful comment

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.

All 2 comments

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:

Was this page helpful?
0 / 5 - 0 ratings