mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-12 02:04:20 +01:00
📱 输入框判断改进
This commit is contained in:
parent
1ad1f14c7a
commit
85ad5f2333
2 changed files with 4 additions and 2 deletions
|
|
@ -4,7 +4,7 @@
|
|||
"description": "Refactor your thinking",
|
||||
"homepage": "https://b3log.org/siyuan",
|
||||
"main": "./electron/main.js",
|
||||
"packageManager": "pnpm@10.28.2",
|
||||
"packageManager": "pnpm@10.29.2",
|
||||
"scripts": {
|
||||
"lint": "eslint . --fix --cache",
|
||||
"dev": "webpack --mode development",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue