fix: Tab no longer works to nest lists (regression from comment merge)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
15
shared/editor/plugins/PreventTab.ts
Normal file
15
shared/editor/plugins/PreventTab.ts
Normal 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,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user