mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
[WIKI-557] fix: keyboard navigation in tables (#7428)
This commit is contained in:
committed by
GitHub
parent
3783e34ae8
commit
48f1999c95
@@ -219,23 +219,31 @@ export const Table = Node.create<TableOptions>({
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
Tab: () => {
|
||||
if (this.editor.isActive(CORE_EXTENSIONS.TABLE)) {
|
||||
if (this.editor.isActive(CORE_EXTENSIONS.LIST_ITEM) || this.editor.isActive(CORE_EXTENSIONS.TASK_ITEM)) {
|
||||
return false;
|
||||
}
|
||||
if (this.editor.commands.goToNextCell()) {
|
||||
return true;
|
||||
}
|
||||
if (!this.editor.isActive(CORE_EXTENSIONS.TABLE)) return false;
|
||||
|
||||
if (!this.editor.can().addRowAfter()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.editor.chain().addRowAfter().goToNextCell().run();
|
||||
if (this.editor.isActive(CORE_EXTENSIONS.LIST_ITEM) || this.editor.isActive(CORE_EXTENSIONS.TASK_ITEM)) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
if (this.editor.commands.goToNextCell()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!this.editor.can().addRowAfter()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.editor.chain().addRowAfter().goToNextCell().run();
|
||||
},
|
||||
"Shift-Tab": () => {
|
||||
if (!this.editor.isActive(CORE_EXTENSIONS.TABLE)) return false;
|
||||
|
||||
if (this.editor.isActive(CORE_EXTENSIONS.LIST_ITEM) || this.editor.isActive(CORE_EXTENSIONS.TASK_ITEM)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.editor.commands.goToPreviousCell();
|
||||
},
|
||||
"Shift-Tab": () => this.editor.commands.goToPreviousCell(),
|
||||
Backspace: handleDeleteKeyOnTable,
|
||||
"Mod-Backspace": handleDeleteKeyOnTable,
|
||||
Delete: handleDeleteKeyOnTable,
|
||||
|
||||
Reference in New Issue
Block a user