diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts index fd411e3a7..783522e4f 100644 --- a/app/src/protyle/util/onGet.ts +++ b/app/src/protyle/util/onGet.ts @@ -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)) { diff --git a/app/src/protyle/wysiwyg/getBlock.ts b/app/src/protyle/wysiwyg/getBlock.ts index 9473c65ee..3cb81d851 100644 --- a/app/src/protyle/wysiwyg/getBlock.ts +++ b/app/src/protyle/wysiwyg/getBlock.ts @@ -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]");