Vanessa 2025-12-17 09:58:37 +08:00
parent d30ba8049c
commit 9f55cd125d
2 changed files with 10 additions and 3 deletions

View file

@ -2,6 +2,7 @@ import {Constants} from "../constants";
import {genItemPanel} from "./index";
import {keymap} from "./keymap";
import {App} from "../index";
import {isPhablet} from "../protyle/util/compatibility";
const getLang = (keys: string[]) => {
const langArray: string[] = [];
@ -106,9 +107,11 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
"vacuumDataIndex", "vacuumDataIndexTip", "rebuildDataIndex", "rebuildDataIndexTip"]),
];
const inputElement = element.querySelector(".b3-form__icon input") as HTMLInputElement;
/// #if !BROWSER
inputElement.focus();
/// #endif
if (!isPhablet()) {
inputElement.focus();
} else {
(document.activeElement as HTMLElement)?.blur();
}
const updateTab = () => {
const indexList: number[] = [];
const inputValue = inputElement.value;

View file

@ -8,6 +8,10 @@ import {clipboard, ipcRenderer} from "electron";
import {processSYLink} from "../../editor/openLink";
/// #endif
export const isPhablet = () => {
return /Android|webOS|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|Tablet/i.test(navigator.userAgent) || isIPhone() || isIPad();
};
export const encodeBase64 = (text: string): string => {
if (typeof Buffer !== "undefined") {
return Buffer.from(text, "utf8").toString("base64");