Vanessa 2026-01-27 21:21:21 +08:00
parent 45e6ee96c1
commit bcb725f0ad
2 changed files with 4 additions and 1 deletions

View file

@ -482,7 +482,7 @@ const focusElementById = (protyle: IProtyle, action: string[], scrollAttr?: IScr
if (scrollAttr && scrollAttr.focusId) {
range = focusByOffset(focusElement, scrollAttr.focusStart, scrollAttr.focusEnd) as Range;
} else {
focusBlock(focusElement, undefined, action.includes(Constants.CB_GET_OUTLINE) ? false : true);
range = focusBlock(focusElement, undefined, !action.includes(Constants.CB_GET_OUTLINE)) as Range;
}
/// #if !MOBILE
if (!action.includes(Constants.CB_GET_UNUNDO)) {

View file

@ -82,6 +82,9 @@ export const getContenteditableElement = (element: Element): Element => {
if (!element) {
return element;
}
if (element.classList.contains("protyle-title__input")) {
return element;
}
let blockElement = element;
if (!blockElement.getAttribute("data-node-id")) {
blockElement = element.querySelector("[data-node-id]");