diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c997b5185..9868b8dd5 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -7,7 +7,7 @@ ## NPM dependencies -Install pnpm: `npm install -g pnpm@10.28.2` +Install pnpm: `npm install -g pnpm@10.29.2`
For China mainland diff --git a/.github/CONTRIBUTING_zh_CN.md b/.github/CONTRIBUTING_zh_CN.md index 0aa01951b..c70e5375d 100644 --- a/.github/CONTRIBUTING_zh_CN.md +++ b/.github/CONTRIBUTING_zh_CN.md @@ -7,7 +7,7 @@ ## NPM 依赖 -安装 pnpm:`npm install -g pnpm@10.28.2` +安装 pnpm:`npm install -g pnpm@10.29.2`
适用于中国大陆 diff --git a/app/src/mobile/index.ts b/app/src/mobile/index.ts index b00fb72c6..ab558abdd 100644 --- a/app/src/mobile/index.ts +++ b/app/src/mobile/index.ts @@ -107,7 +107,7 @@ class App { const wysisygElement = hasClosestByClassName(event.target, "protyle-wysiwyg", true); let editElement: HTMLElement; if ((event.target.tagName === "TEXTAREA" || - (event.target.tagName === "INPUT" && ["email", "number", "password", "search", "tel", "text", "url", ""].includes(event.target.getAttribute("type")))) && + (event.target.tagName === "INPUT" && ["email", "number", "password", "search", "tel", "text", "url", "", null].includes(event.target.getAttribute("type")))) && event.target.getAttribute("readonly") !== "readonly") { editElement = event.target; } else if (wysisygElement && wysisygElement.getAttribute("data-readonly") === "false") { diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts index 54730cb16..b063a1b4e 100644 --- a/app/src/mobile/util/keyboardToolbar.ts +++ b/app/src/mobile/util/keyboardToolbar.ts @@ -439,12 +439,14 @@ export const showKeyboardToolbar = () => { } const range = getSelection().getRangeAt(0); const editor = getCurrentEditor(); - if (editor && editor.protyle.wysiwyg.element.contains(range.startContainer)) { - editor.protyle.element.parentElement.style.paddingBottom = "48px"; + if (editor) { + if (editor.protyle.wysiwyg.element.contains(range.startContainer)) { + editor.protyle.element.parentElement.style.paddingBottom = "48px"; + } + editor.protyle.app.plugins.forEach(item => { + item.eventBus.emit("mobile-keyboard-show"); + }); } - getCurrentEditor().protyle.app.plugins.forEach(item => { - item.eventBus.emit("mobile-keyboard-show"); - }); setTimeout(() => { const contentElement = hasClosestByClassName(range.startContainer, "protyle-content", true); if (contentElement) { @@ -475,14 +477,14 @@ export const hideKeyboardToolbar = () => { const editor = getCurrentEditor(); if (editor) { editor.protyle.element.parentElement.style.paddingBottom = ""; + editor.protyle.app.plugins.forEach(item => { + item.eventBus.emit("mobile-keyboard-hide"); + }); } const modelElement = document.getElementById("model"); if (modelElement.style.transform === "translateY(0px)") { modelElement.style.paddingBottom = ""; } - getCurrentEditor().protyle.app.plugins.forEach(item => { - item.eventBus.emit("mobile-keyboard-hide"); - }); }; export const activeBlur = () => {