1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Lexical: Changed table esacpe handling

Avoids misuse of selectPrevious/Next as per prior commit which was then
causing problems elsewhere, and is probably best to avoid creation in
those select methods anyway.
This commit is contained in:
Dan Brown
2025-05-26 18:47:51 +01:00
parent a43a1832f5
commit 2e718c12e1
4 changed files with 19 additions and 19 deletions

View File

@@ -13,7 +13,7 @@ import {
import {$isImageNode} from "@lexical/rich-text/LexicalImageNode";
import {$isMediaNode} from "@lexical/rich-text/LexicalMediaNode";
import {getLastSelection} from "../utils/selection";
import {$getNearestNodeBlockParent, $getParentOfType} from "../utils/nodes";
import {$getNearestNodeBlockParent, $getParentOfType, $selectOrCreateAdjacent} from "../utils/nodes";
import {$setInsetForSelection} from "../utils/lists";
import {$isListItemNode} from "@lexical/list";
import {$isDetailsNode, DetailsNode} from "@lexical/rich-text/LexicalDetailsNode";
@@ -81,13 +81,8 @@ function focusAdjacentOrInsertForSingleSelectNode(editor: LexicalEditor, event:
event?.preventDefault();
const node = selectionNodes[0];
editor.update(() => {
if (after) {
node.selectNext();
} else {
node.selectPrevious();
}
$selectOrCreateAdjacent(node, after);
});
return true;