Vanessa 2026-02-03 20:40:59 +08:00
parent efbc2bf814
commit 637e11cdba

View file

@ -33,21 +33,14 @@ export const handleTouchEnd = (event: TouchEvent, app: App) => {
if ((["INPUT", "TEXTAREA"].includes(target.tagName) && target.getAttribute("readonly") !== "true") ||
(wysisygElement && wysisygElement.getAttribute("data-readonly") === "false")) {
if (target.tagName === "INPUT" || target.tagName === "TEXTAREA") {
target.setAttribute("readonly", "false");
setTimeout(() => {
target.removeAttribute("readonly");
window.JSAndroid?.showKeyboard();
}, 0);
target.setAttribute("virtualkeyboardpolicy", "manual");
} else {
const editElement = hasClosestByAttribute(target, "contenteditable", "true");
if (editElement) {
editElement.setAttribute("contenteditable", "false");
setTimeout(() => {
editElement.setAttribute("contenteditable", "true");
window.JSAndroid?.showKeyboard();
}, 0);
editElement.setAttribute("virtualkeyboardpolicy", "manual");
}
}
window.JSAndroid?.showKeyboard();
} else {
window.JSAndroid?.hideKeyboard();
}