You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop grid cells remounting on every click so double-click can edit #841
Severity: P1 (blocks inline editing with the mouse).
What happens
On http://localhost:1420/?mock=connected:
Run SELECT * FROM products and click Edit Mode.
Double-click any cell (e.g. name in row 1). No input appears. Clicking a cell and pressing Enter does nothing either.
A synthetic dblclick event dispatched straight onto the cell's inner element does open the input, so the edit handler works. The problem is that the cell's DOM node is replaced between the two clicks. The node holding the cell content before a single click is no longer in the document after it.
Outside Edit Mode, double-clicking a long TEXT cell (e.g. description) does not open the cell viewer either, for the same reason. Only the hover "View full content" button opens it.
Cause
src/hooks/useGridEditing.ts:311 returns a new object on every render.
That object is a dependency of the columns memo in src/hooks/useGridColumns.tsx:120, so every render builds new inline cell renderers.
flexRender treats each new function as a new component type, so React unmounts and remounts every cell.
The first click of a double-click selects the row (clickRow changes state), which triggers a re-render. The second click lands on a freshly mounted element, and the browser never fires dblclick.
Fix
Memoise the return value of useGridEditing (or make useGridColumns depend only on its stable callbacks and the values it reads). Render cells through a stable component that gets the editing state from props or context instead of a closure. Add a test that a cell's DOM node survives a row click.
Activity
fix(grid): keep cells mounted so double-click edits
release: 1.4.0 (#871)