I am using MudBlazor and I would like to detect a double click on a single table row and react to the event. However, there is no double click listed in the API of the table. The single click is easy to do with the OnRowClick
callback (see also here on SO). There is no equivalent for double clicks.
I tried using the Blazor event ondblclick
with
<MudTd @ondblclick="OnOrderDbClicked">
// ...
<MudTd/>
I have two issues with this:
- I can catch the double click. But I cannot make it aware of the row that was clicked (for which I'd have a workaround).
- Also I'd have to add to to each cell because the
<RowTemplate/>
element just won't accept it.
I only have a crutch for issue 1: Bind a variable MyOrderVM MyItem
to the SelectedItem
item parameter of the table and access the object in the method that is called by the double click (because a double click also causes two single clicks which select the item).
I haven't done a lot of testing but it seems this could work but isn't there a better solution? Or do I worry to much about side effects?