1

Can i use onRowClicked and onRowDoubleClicked at the same time in ag-grid, when i use them both, only onRowClicked is executed.

Di_
  • 91
  • 2
  • 12

2 Answers2

2

I've just checked and there's no problem with having both events handled:

onRowClicked={() => console.log('Row clicked')}
onRowDoubleClicked={() => console.log('Row double clicked')}

As expected, "Row clicked" is logged before "Row double clicked".

I've checked with:

  • "@ag-grid-community/react": "^22.1.2",
  • "@ag-grid-enterprise/all-modules": "^22.1.2"
user1068352
  • 591
  • 6
  • 14
1

There is a serious problem with the implementation though...

When you double click, the click event fires first and it tagged as a "click". So your click handler has no way to know that it's just part of a double click which will be handled elsewhere.

Would have been far more useful if the click event was tagged as a double click. As it is, you have to use your own logic to delay handling the click until after you can determine if it's a double click or not.

Ian Bale
  • 191
  • 9