Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://ld246.com/article/1667819182002

Vanessa0e5b85f8dc57
diff --git a/app/src/mobile/util/showKeyboardToolbar.ts b/app/src/mobile/util/showKeyboardToolbar.ts
index dd95a43016..302e212482 100644
--- a/app/src/mobile/util/showKeyboardToolbar.ts
+++ b/app/src/mobile/util/showKeyboardToolbar.ts
@@ -22,17 +22,19 @@ export const showKeyboardToolbar = (bottom = 0) => {
toolbarElement.classList.remove("fn__none");
toolbarElement.style.bottom = bottom + "px";
- const contentElement = window.siyuan.mobileEditor.protyle.contentElement
- const cursorTop = getSelectionPosition(contentElement).top - contentElement.getBoundingClientRect().top;
- if (cursorTop < window.innerHeight - 96) {
- return;
- }
- contentElement.scroll({
- top: contentElement.scrollTop + cursorTop - ((window.outerHeight - 65) / 2 - 30),
- left: contentElement.scrollLeft,
- behavior: "smooth"
- });
- alert(cursorTop + "," + window.innerHeight);
+ setTimeout(() => {
+ const contentElement = window.siyuan.mobileEditor.protyle.contentElement
+ const cursorTop = getSelectionPosition(contentElement).top - contentElement.getBoundingClientRect().top;
+ if (cursorTop < window.innerHeight - 96) {
+ return;
+ }
+ contentElement.scroll({
+ top: contentElement.scrollTop + cursorTop - ((window.outerHeight - 65) / 2 - 30),
+ left: contentElement.scrollLeft,
+ behavior: "smooth"
+ });
+ alert(cursorTop + "," + window.innerHeight);
+ })
// if ("android" === window.siyuan.config.system.container && window.JSAndroid) {
// // Android 端事件需要滞后一些,所以这里延迟一下
// setTimeout(() => {