glide-data-grid
glide-data-grid copied to clipboard
`fillHandle` improvements
We recently started adding copy, paste and fill support for our grid, which has been amazingly easy to do. Great work!
There are a few minor issues around the fillHandle
that would be great to improve:
Right now there is no way to control which cells the fill handle is shown for. It even seems to be shown for readonly (or more specifically allowOverlay: false
) cells, and will attempt to fill them if you do drag. It seems like by default it shouldn't be shown on readonly cells, but it would be even better to add some sort of shouldShowFillHandle
callback to prevent filling cells that are editable but don't make sense to be filled. This can sort of be accomplished in onCellEdited
, although I can't find a way to determine whether the cell was edited via filling vs an individual cell edit.
Additionally, it would be great if fillHandle
or maybe a new onFill
property would also accept a function similar to onPaste
. A basic version of this could do the same sort of cancelling when onPaste
returns false, but it would be nice if this could also return a new GridSelection
to specify which cells should actually be filled.
It's definitely nice-to-have, but adding a way to customize how the fill handle is rendered would be great. Perhaps this could optionally take a sprite similar to the headers or trailing row.
+1 for allowing per-column or per-cell version of fillHandle.
A very useful feature for me would be allowing to override behavior of filling to generating consequential items.
E.g. ids or seats or inventory items, like if filling from cell with 1000, next cells would get 1001, 1002, etc. No need to implement this logic, but a callback would be very helpful.
This would be great to have @jassmith. A fillHandle
prop that works similar to the grid selection
there is now an onFillPattern that does what is needed here.