mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-10-02 06:18:30 +00:00
Merge branch 'pr-547'
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user