mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-12 10:14:21 +01:00
📱 输入框判断改进
This commit is contained in:
parent
85ad5f2333
commit
e502c53c7d
2 changed files with 17 additions and 0 deletions
|
|
@ -104,6 +104,9 @@ 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -574,6 +574,20 @@
|
|||
new WebSocket((window.location.protocol === 'https:' ? 'wss' : 'ws') + '://' + window.location.host + '/ws?app=siyuan&id=auth')
|
||||
}
|
||||
init();
|
||||
window.addEventListener("click", (event) => {
|
||||
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) {
|
||||
window.JSHarmony.showKeyboard();
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue