📱 输入框判断改进

This commit is contained in:
Vanessa 2026-02-10 16:56:57 +08:00
parent 1ad1f14c7a
commit 85ad5f2333
2 changed files with 4 additions and 2 deletions

View file

@ -100,7 +100,9 @@ class App {
}
const wysisygElement = hasClosestByClassName(event.target, "protyle-wysiwyg", true);
let editElement: HTMLElement;
if (["INPUT", "TEXTAREA"].includes(event.target.tagName) && event.target.getAttribute("readonly") !== "readonly") {
if ((event.target.tagName === "TEXTAREA" ||
(event.target.tagName === "INPUT" && ["email", "number", "password", "search", "tel", "text", "url", ""].includes(event.target.getAttribute("type")))) &&
event.target.getAttribute("readonly") !== "readonly") {
editElement = event.target;
} else if (wysisygElement && wysisygElement.getAttribute("data-readonly") === "false") {
editElement = hasClosestByAttribute(event.target, "contenteditable", "true") as HTMLElement;