Devextreme-reactive: TableEditColumn Delete Command does not preventDefault

Created on 7 Jan 2020  路  4Comments  路  Source: DevExpress/devextreme-reactive

  • [X] I have searched this repository's issues and believe that this is not a duplicate.

I'm using ...

  • [X] React Grid
  • [ ] React Chart
  • [ ] React Scheduler

Current Behaviour


I have a Table.Row with an onClick event handler, and a TableEditColumn with an onCommitChanges handler.

Clicking on the 'Delete' icon in the TableEditColumn causes both the onCommitChanges and onClick events to trigger.

Expected Behaviour


The option is available somewhere to have the 'Delete' command preventDefault or stop propagation somehow.

Steps to Reproduce

https://codesandbox.io/s/devextreme-react-grid-for-material-ui-py5f8?fontsize=14&hidenavigation=1&theme=dark

Grid question

All 4 comments

Hello,

You can use stopPropagation inside your Command component as I've done for DeleteButton here. In this case the Row's onClick is not triggered any more on DeleteButton click.
Does this solution suit you?

If you have any other questions, feel free to ask them.

Yep, that works a charm. Thank you very much!

I am glad that it helped!

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests.

Was this page helpful?
0 / 5 - 0 ratings