mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Lexical: Added tests to cover recent changes
Also updated list tests to new test process.
This commit is contained in:
@@ -79,22 +79,19 @@ function focusAdjacentOrInsertForSingleSelectNode(editor: LexicalEditor, event:
|
||||
const nearestBlock = $getNearestNodeBlockParent(node) || node;
|
||||
let target = after ? nearestBlock.getNextSibling() : nearestBlock.getPreviousSibling();
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
editor.update(() => {
|
||||
if (!target) {
|
||||
target = $createParagraphNode();
|
||||
if (after) {
|
||||
nearestBlock.insertAfter(target)
|
||||
} else {
|
||||
nearestBlock.insertBefore(target);
|
||||
}
|
||||
editor.update(() => {
|
||||
if (!target) {
|
||||
target = $createParagraphNode();
|
||||
if (after) {
|
||||
nearestBlock.insertAfter(target)
|
||||
} else {
|
||||
nearestBlock.insertBefore(target);
|
||||
}
|
||||
}
|
||||
|
||||
target.selectStart();
|
||||
});
|
||||
target.selectStart();
|
||||
});
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user