FIX: Adds sheet "block" navigation

This was a left over from the old days

Control+right arrow takes you to the next cell with text
or the end of the block

NB: Missing tests
This commit is contained in:
Nicolás Hatcher
2025-07-17 07:28:50 +02:00
committed by Nicolás Hatcher Andrés
parent 1eea2a8c46
commit 46b1ade34a
4 changed files with 118 additions and 5 deletions

View File

@@ -249,8 +249,8 @@ const Workbook = (props: { model: Model; workbookState: WorkbookState }) => {
onToggleUnderline(!value);
},
onNavigationToEdge: (direction: NavigationKey): void => {
console.log(direction);
throw new Error("Function not implemented.");
model.onNavigateToEdgeInDirection(direction);
setRedrawId((id) => id + 1);
},
onPageDown: (): void => {
model.onPageDown();

View File

@@ -74,7 +74,11 @@ const useKeyboardNavigation = (
if (event.metaKey || event.ctrlKey) {
switch (key) {
case "z": {
options.onUndo();
if (event.shiftKey) {
options.onRedo();
} else {
options.onUndo();
}
event.stopPropagation();
event.preventDefault();