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
0b439c7228
commit
55b8707f9d
1 changed files with 7 additions and 2 deletions
|
|
@ -609,12 +609,12 @@ export const initKeyboardToolbar = () => {
|
|||
if (type === "done") {
|
||||
if (toolbarElement.clientHeight > 100) {
|
||||
hideKeyboardToolbarUtil();
|
||||
focusByRange(range);
|
||||
if (window.JSAndroid && window.JSAndroid.showKeyboard) {
|
||||
window.JSAndroid.showKeyboard();
|
||||
} else if (window.JSHarmony && window.JSHarmony.showKeyboard) {
|
||||
window.JSHarmony.showKeyboard();
|
||||
}
|
||||
setTimeout(() => focusByRange(range), 256);
|
||||
} else {
|
||||
activeBlur();
|
||||
}
|
||||
|
|
@ -696,7 +696,12 @@ export const initKeyboardToolbar = () => {
|
|||
} else if (type === "add") {
|
||||
if (buttonElement.classList.contains("protyle-toolbar__item--current")) {
|
||||
hideKeyboardToolbarUtil();
|
||||
focusByRange(range);
|
||||
if (window.JSAndroid && window.JSAndroid.showKeyboard) {
|
||||
window.JSAndroid.showKeyboard();
|
||||
} else if (window.JSHarmony && window.JSHarmony.showKeyboard) {
|
||||
window.JSHarmony.showKeyboard();
|
||||
}
|
||||
setTimeout(() => focusByRange(range), 256);
|
||||
} else {
|
||||
(document.activeElement as HTMLElement)?.blur();
|
||||
buttonElement.classList.add("protyle-toolbar__item--current");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue