📱 输入框判断改进

This commit is contained in:
Vanessa 2026-02-10 17:14:19 +08:00
parent e502c53c7d
commit 5325001d24
2 changed files with 5 additions and 7 deletions

View file

@ -94,7 +94,11 @@ class App {
showMessage(window.siyuan.languages.copied, 2000);
event.preventDefault();
}
if (["INPUT", "TEXTAREA"].includes(event.target.tagName)) {
setTimeout(() => {
event.target.scrollIntoView();
}, Constants.TIMEOUT_TRANSITION);
}
if (isInIOS()) {
return;
}
@ -104,9 +108,6 @@ class App {
(event.target.tagName === "INPUT" && ["email", "number", "password", "search", "tel", "text", "url", ""].includes(event.target.getAttribute("type")))) &&
event.target.getAttribute("readonly") !== "readonly") {
editElement = event.target;
setTimeout(() => {
editElement.scrollIntoView();
}, Constants.TIMEOUT_TRANSITION);
} else if (wysisygElement && wysisygElement.getAttribute("data-readonly") === "false") {
editElement = hasClosestByAttribute(event.target, "contenteditable", "true") as HTMLElement;
}

View file

@ -578,9 +578,6 @@
if (event.target.tagName === "INPUT" &&
["email", "number", "password", "search", "tel", "text", "url", ""].includes(event.target.getAttribute("type")) &&
event.target.getAttribute("readonly") !== "readonly") {
setTimeout(() => {
event.target.scrollIntoView();
}, Constants.TIMEOUT_TRANSITION);
if (window.JSAndroid && window.JSAndroid.showKeyboard) {
window.JSAndroid.showKeyboard();
} else if (window.JSHarmony && window.JSHarmony.showKeyboard) {