fix: Tab no longer works to nest lists (regression from comment merge)

This commit is contained in:
Tom Moor
2023-02-25 22:48:31 -05:00
parent f0484c8417
commit b813f20f8f
3 changed files with 17 additions and 4 deletions

View File

@@ -25,6 +25,7 @@ import TableHeadCell from "../nodes/TableHeadCell";
import TableRow from "../nodes/TableRow";
import BlockMenuTrigger from "../plugins/BlockMenuTrigger";
import Folding from "../plugins/Folding";
import PreventTab from "../plugins/PreventTab";
import basicPackage from "./basic";
const fullPackage: (typeof Node | typeof Mark | typeof Extension)[] = [
@@ -53,6 +54,7 @@ const fullPackage: (typeof Node | typeof Mark | typeof Extension)[] = [
BlockMenuTrigger,
Math,
MathBlock,
PreventTab,
];
export default fullPackage;

View File

@@ -24,10 +24,6 @@ export default class Keys extends Extension {
};
return {
// No-ops prevent Tab escaping the editor bounds
Tab: () => true,
"Shift-Tab": () => true,
// Shortcuts for when editor has separate edit mode
"Mod-Escape": onCancel,
"Shift-Escape": onCancel,

View File

@@ -0,0 +1,15 @@
import Extension, { Command } from "../lib/Extension";
export default class PreventTab extends Extension {
get name() {
return "preventTab";
}
keys(): Record<string, Command> {
return {
// No-ops prevent Tab escaping the editor bounds
Tab: () => true,
"Shift-Tab": () => true,
};
}
}