mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-07 16:04:19 +01:00
🎨 Improve soft keyboard toolbar pop-up https://github.com/siyuan-note/siyuan/issues/16548
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
d07ae095bb
commit
286bbee02e
2 changed files with 2 additions and 13 deletions
|
|
@ -683,6 +683,7 @@ export const initKeyboardToolbar = () => {
|
|||
hideKeyboardToolbarUtil();
|
||||
focusByRange(range);
|
||||
} else {
|
||||
document.activeElement.blur();
|
||||
buttonElement.classList.add("protyle-toolbar__item--current");
|
||||
toolbarElement.querySelector('.keyboard__action[data-type="done"] use').setAttribute("xlink:href", "#iconCloseRound");
|
||||
const oldScrollTop = protyle.contentElement.scrollTop;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import {activeBlur} from "./keyboardToolbar";
|
|||
import {isIPhone} from "../../protyle/util/compatibility";
|
||||
import {App} from "../../index";
|
||||
import {globalTouchEnd, globalTouchStart} from "../../boot/globalEvent/touch";
|
||||
import {Constants} from "../../constants";
|
||||
|
||||
let clientX: number;
|
||||
let clientY: number;
|
||||
|
|
@ -38,18 +37,7 @@ export const handleTouchEnd = (event: TouchEvent, app: App) => {
|
|||
editElement = hasClosestByAttribute(target, "contenteditable", "true") as HTMLElement;
|
||||
}
|
||||
if (editElement) {
|
||||
if (editElement.getAttribute("virtualkeyboardpolicy") !== "manual") {
|
||||
editElement.setAttribute("virtualkeyboardpolicy", "manual");
|
||||
setTimeout(() => {
|
||||
editElement.focus();
|
||||
window.JSAndroid?.showKeyboard();
|
||||
}, Constants.TIMEOUT_TRANSITION);
|
||||
} else {
|
||||
editElement.focus();
|
||||
window.JSAndroid?.showKeyboard();
|
||||
}
|
||||
} else {
|
||||
window.JSAndroid?.hideKeyboard();
|
||||
window.JSAndroid?.showKeyboard();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue