feat: Double-link: In-line cursor handling, e.g., up, down, left,right, backspace keys

This commit is contained in:
xiaodong zuo
2022-08-29 18:10:26 +08:00
parent 6d770dbfa6
commit 73d6e34c5d
5 changed files with 85 additions and 96 deletions
@@ -405,11 +405,11 @@ Editor.before = function (
if (element) {
if (isInlineAndVoid(editor, element)) {
// Inline entities need to be drilled out
// target = Editor.before(editor, target);
target = {
path: [0, path[1] - 1],
offset: 0,
};
target = Editor.before(editor, target);
// target = {
// path: [0, path[1] - 1],
// offset: 0,
// };
} else if (editor.isInline(element) && !editor.isVoid(element)) {
// Inline styles such as hyperlinks need to drill directly into it
const inlineTextLength = element?.children?.[0]?.text?.length;