formview fixes

This commit is contained in:
Jan Prochazka
2021-11-20 08:36:58 +01:00
parent c1a9641ce5
commit 0084cbcb63
3 changed files with 21 additions and 4 deletions

View File

@@ -398,7 +398,9 @@
} else {
// @ts-ignore
event.preventDefault();
dispatchInsplaceEditor({ type: 'show', text: event.key, cell: currentCell });
if (rowData) {
dispatchInsplaceEditor({ type: 'show', text: event.key, cell: currentCell });
}
}
}
@@ -425,7 +427,9 @@
if (event.keyCode == keycodes.f2) {
// @ts-ignore
dispatchInsplaceEditor({ type: 'show', cell: currentCell, selectAll: true });
if (rowData) {
dispatchInsplaceEditor({ type: 'show', cell: currentCell, selectAll: true });
}
}
handleCursorMove(event);
@@ -544,8 +548,9 @@
isCurrentCell={currentCell[0] == rowIndex && currentCell[1] == chunkIndex * 2 + 1}
onDictionaryLookup={() => handleLookup(col)}
>
{#if $inplaceEditorState.cell && rowIndex == $inplaceEditorState.cell[0] && chunkIndex * 2 + 1 == $inplaceEditorState.cell[1]}
{#if rowData && $inplaceEditorState.cell && rowIndex == $inplaceEditorState.cell[0] && chunkIndex * 2 + 1 == $inplaceEditorState.cell[1]}
<InplaceEditor
fillParent
width={getCellWidth(rowIndex, chunkIndex * 2 + 1)}
inplaceEditorState={$inplaceEditorState}
{dispatchInsplaceEditor}