This commit is contained in:
Vanessa 2025-02-09 13:34:47 +08:00
parent 1da6bd10dd
commit fac82ad618
5 changed files with 10 additions and 10 deletions

View file

@ -168,7 +168,7 @@ export const isEndOfBlock = (range: Range) => {
return false;
}
let nextSibling = range.endContainer
let nextSibling = range.endContainer;
while (nextSibling) {
if (hasNextSibling(nextSibling)) {
return false;
@ -176,12 +176,12 @@ export const isEndOfBlock = (range: Range) => {
if (nextSibling.parentElement.getAttribute("spellcheck")) {
return true;
}
nextSibling = nextSibling.parentElement
nextSibling = nextSibling.parentElement;
}
}
return true;
}
};
export const hasPreviousSibling = (element: Node) => {
let previousSibling = element.previousSibling;

View file

@ -342,7 +342,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
event.stopPropagation();
return;
}
const nodeEditableElement = getContenteditableElement(nodeElement)
const nodeEditableElement = getContenteditableElement(nodeElement);
const position = getSelectionOffset(nodeEditableElement, protyle.wysiwyg.element, range);
if (position.start === 0 && event.key === "ArrowLeft") {
event.preventDefault();