-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGrid] double-clicking cells to edit them is flakey #547
Comments
I investigated this a bit. Double clicking to edit seems to work reliably if I do one of:
Without those and if I accidentally move the mouse a tiny bit between clicks, it doesn't just ignore that double click but future ones as well in that column and some others (not sure what the exact pattern is). It recovers if I single click various cells in different columns, again not sure exactly what kind of cells or how many times. It's sort of unpredictably flakey after the first imprecise double click. |
To clarify, I don't even get a dblclick event once the flakiness starts. I don't just bail early from the handler. |
Another clue is that if I comment out this line:
A failed double click will select cells between (0,0) and the clicked cell. While that selection is visible, double clicking to edit is seemingly randomly broken. So this seems like a conflict between dragging the mouse to select cells vs double clicking to edit. It breaks if it thinks both happen simultaneously. As you mentioned, once it's broken, |
Actually it breaks if I make the tiniest drag movement. So after page load double clicking to edit by lifting the mouse is initially reliable but if I hold the mouse button pressed and move it by one pixel inside one cell, it becomes flakey in nearby cells. The dblclick event doesn't fire at all. It's all happening inside the same canvas element so I can't see what's blocking the event. |
OK, so when the button is pressed, a DOM node is inserted with the class Edit: If I add this in
I can see the enormous box that's messing with my attempts to edit cells 🤣 |
And, of course, I can fix the bug from my own code with:
It's still sad that double clicks aren't detected if the mouse moves the tiniest bit during them, but at least it won't break everything if I ever fail to execute a perfect double click. |
Interesting, looks like this
Would you like to open a PR to fix it? |
Sure! Guess I'll just add the pointer-events fix to packages/dragdrop/style/index.css where that div is given all the other, in this case troublesome styles. Edit: #564 |
The rabbit hole continues in the PR and is deeper than expected. |
The .lm-cursor-backdrop div was preventing dblclick events from reaching datagrid, breaking cell edit functionality.
The .lm-cursor-backdrop div was preventing dblclick events from reaching datagrid, breaking cell edit functionality.
Description
Double-clicking editable cells is meant to actuate an editor to change their values (see #14).
From my experience with the example DataGrids (here), the
dblclick
event does not reliably fire and it's not always possible to see the editor.I also noticed the same while working on #546 which also relies on
dblclick
events.Reproduce
You can always trigger the edit mode by selecting a cell and starting to type though.
Expected behavior
dblclick
events should be consistently fired and trigger the editor.Context
The text was updated successfully, but these errors were encountered: