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
Switching result sets keeps the grid's pending edits #869
The grid's pending edits are kept by row index in useGridEditing, and nothing clears them when the user switches between the result sets of one run (the "Result 1 / Result 2" tabs above the grid, setActiveResult). Save then applies them to the result set now shown, which can be another table.
How to see it
Run SELECT * FROM customers; SELECT * FROM orders;.
On Result 1, turn on Edit Mode and change a cell in row 3.
Click Result 2. Row 3 of orders shows as edited, and Save writes the change against orders.
Cause
src/components/grid/ResultsGrid.tsx passes results (the whole array) as the owner of the edits to useGridEditing, and activeResultIndex changes do not touch the editing state. The fix for #865 on PR #866 drops edits when results changes, but not when only activeResultIndex does.
Fix
Pass the active result (results[activeResultIndex]) as the edits' owner, so switching result sets drops, or better asks about, the pending edits. Alternatively keep pending edits per result set.
Activity
release: 1.4.0 (#871)