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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user