Merge branch 'pr-547'

This commit is contained in:
Mathium05
2026-09-28 13:24:14 -05:00
+7 -1
View File
@@ -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<string, void>("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;