[Editor] Add the possibility to move the caret with the keyboard once an highlight has been made (bug 1881684)

This commit is contained in:
Calixte Denizet 2024-02-26 10:39:44 +01:00
parent 9600c48d4f
commit a9f47e87d5
3 changed files with 146 additions and 2 deletions

View file

@ -947,7 +947,7 @@ class AnnotationEditorUIManager {
if (!selection || selection.isCollapsed) {
return;
}
const { anchorNode } = selection;
const { anchorNode, anchorOffset, focusNode, focusOffset } = selection;
const anchorElement =
anchorNode.nodeType === Node.TEXT_NODE
? anchorNode.parentElement
@ -966,6 +966,10 @@ class AnnotationEditorUIManager {
layer.createAndAddNewEditor({ x: 0, y: 0 }, false, {
methodOfCreation,
boxes,
anchorNode,
anchorOffset,
focusNode,
focusOffset,
});
break;
}