diff --git a/src/webpage/markdown.ts b/src/webpage/markdown.ts index 7efc520..4d94d84 100644 --- a/src/webpage/markdown.ts +++ b/src/webpage/markdown.ts @@ -7,6 +7,8 @@ import {Dialog} from "./settings.js"; import {Contextmenu} from "./contextmenu.js"; import {highlight} from "./highlighter/index.js"; import {TypeBox} from "./typeBox.js"; +import {mobile} from "./utils/utils"; + const linkMenu = new Contextmenu("copyLink", true); linkMenu.addButton( () => I18n.copyRegLink(), @@ -1460,7 +1462,7 @@ function saveCaretPosition( len = Math.min(len, txtLengthFunc(context).length); len += offset; - return function restore(_backspace = false) { + return function restore(backspace = false) { if (!selection) return; const pos = getTextNodeAtPosition(context, len, txtLengthFunc); if ( @@ -1480,6 +1482,10 @@ function saveCaretPosition( const range = new Range(); range.setStart(pos.node, pos.position); selection.addRange(range); + + if(mobile && !backspace && !TypeBox.box.textContent){ + TypeBox.box.blur(); + } }; } catch { return undefined;