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
Is there a way to prevent opening the overlay editor on row or col append?
I want to append a new row after finishing editing a cell on the trailing row, but not have it enter cell editing mode. This is because I'd prefer normal cell selection, since I'm using arrow keys on trailing rows (and cols) to resize if no content. Demo below:
CleanShot.2022-12-02.at.14.42.45.mp4
The current flow is
// https://github.com/glideapps/glide-data-grid/blob/main/packages/core/src/data-editor/data-editor.tsxonFinishEditingupdateSelectedCell// if editing trailing rowsetGridSelectionappendRow
Wondering if we can instead customize this default behavior within a custom appendRow in onFinishEditing, like so
const[movX,movY]=movement;if(gridSelection.current!==undefined&&(movX!==0||movY!==0)){constisEditingTrailingRow=newValue!==undefined&&gridSelection.current.cell[1]===mangledRows-1;constisEditingTrailingCol=newValue!==undefined&&gridSelection.current.cell[0]===mangledCols.length-1;letupdateSelected=true;if(isEditingTrailingCol&&movX===1){updateSelected=false;constrow=gridSelection.current.cell[1]+movY;appendColumn(row,false);// Don't open overlay editor on append.}if(isEditingTrailingRow&&movY===1){updateSelected=false;constcol=gridSelection.current.cell[0]+movX;constcustomTargetColumn=getCustomNewRowTargetColumn(col);appendRow(customTargetColumn??col,false);// Don't open overlay editor on append.}updateSelected&&updateSelectedCell(gridSelection.current.cell[0]+movX,gridSelection.current.cell[1]+movY,false,false);}onFinishedEditing?.(newValue,movement);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Sort of a duplicate of #387
Is there a way to prevent opening the overlay editor on row or col append?
I want to append a new row after finishing editing a cell on the trailing row, but not have it enter cell editing mode. This is because I'd prefer normal cell selection, since I'm using arrow keys on trailing rows (and cols) to resize if no content. Demo below:
CleanShot.2022-12-02.at.14.42.45.mp4
The current flow is
Wondering if we can instead customize this default behavior within a custom
appendRow
inonFinishEditing
, like soAnd change the api for
appendRow
toBeta Was this translation helpful? Give feedback.
All reactions