Reputation: 101
Can i use onRowClicked and onRowDoubleClicked at the same time in ag-grid, when i use them both, only onRowClicked is executed.
Upvotes: 1
Views: 4701
Reputation: 201
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.
Upvotes: 2
Reputation: 632
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:
Upvotes: 3