Material-table: disableClick column prop not disabling onRowClick function call

Created on 15 Feb 2019  路  7Comments  路  Source: mbrn/material-table

Describe the bug
First, this a great library. Thank you!
I am using the onRowClick prop, it works as expected. However, for one column (called Review), I want to disable the onRowClick function from firing. So I added disableClick: true to that column. But the onRowClick function is still firing.

To Reproduce
Steps to reproduce the behavior:

  1. Load the table
  2. Click on a cell in the Review column (the column with disableClick prop set to true)
  3. onRowClick function fires

Expected behavior
I expect the onRowClick function to be disabled when clicking on a cell in a particular column.

Desktop (please complete the following information):

  • OS: MacOS Sierra
  • Browser: Chrome
  • Version: 71

My code (snippets):

<MaterialTable
  title='Title'
  components={{
    FilterRow: props => newFilterRow(props)
  }}
  columns={columns}
  data={data}
  options={options}
  onOrderChange={(column, dir) => this.updateSortParam(column, dir)}
  onRowClick={(event, rowData) => this.openApp(event, rowData)}
/>

Review column (pushed into the columns array)

const reviewColumn = {
  title: 'Review',
  field: 'review',
  disableClick: true,
  defaultFilter: queries.reviewerFilter,
  defaultSort: queries.reviewerSort
}
bug

All 7 comments

Hi @kenecaswell ,

We didn't add a disableClick feature to columns. But this could be add. I will consider this on next releases.

Hi @mbrn,
Thanks for the reply. However, I'm still confused. What is line 52 in the documentation referring to then (see link below)?

https://github.com/mbrn/material-table/blob/master/docz/props.mdx#L52

Hi @kenecaswell ,

You are right sorry. I forget this feature. Because someone else added it to material-table. But it is not working as expected. I will work on it fix it asap.

This is done. You can use version 1.20.0

This is done. You can use version 1.20.0

Is it possible to disableClick for action column/ overwritten action column?

This is done. You can use version 1.20.0

Is it possible to disableClick for action column/ overwritten action column?

Any news about this request? I need also to disable onRowClick events for actions cells...

This is done. You can use version 1.20.0

Is it possible to disableClick for action column/ overwritten action column?

Could this Request be looked at? Would be very helpful
@mbrn Thanks for your work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ps1011 picture ps1011  路  3Comments

KKrisu picture KKrisu  路  3Comments

Mihier-Roy picture Mihier-Roy  路  3Comments

bohrsty picture bohrsty  路  3Comments

balibou picture balibou  路  3Comments