diff --git a/common/resources/src/main/resources/rawfile/rich_editor.js b/common/resources/src/main/resources/rawfile/rich_editor.js index 7c87f5d..119d9f4 100644 --- a/common/resources/src/main/resources/rawfile/rich_editor.js +++ b/common/resources/src/main/resources/rawfile/rich_editor.js @@ -508,6 +508,10 @@ RICH_EDITOR.getFocus = function () { return document.getElementById('editorjs_box').focus(); } +RICH_EDITOR.getBlur = function () { + return document.getElementById('editorjs_box').blur(); +} + document.getElementById('editorjs_box').addEventListener('click', () => { document.getElementById('buttonBox').style.display = 'flex'; }) \ No newline at end of file diff --git a/features/src/main/ets/components/NoteContentComp.ets b/features/src/main/ets/components/NoteContentComp.ets index be331c1..e1f3e95 100644 --- a/features/src/main/ets/components/NoteContentComp.ets +++ b/features/src/main/ets/components/NoteContentComp.ets @@ -757,6 +757,7 @@ export struct ToolBarComp { .onClick(() => { // 保存笔记信息到数据库 this.controllerShow.runJavaScript("getHtmlContent()") + this.controllerShow.runJavaScript("javascript:RICH_EDITOR.getBlur()") if (this.selectedNoteData.title == "标题" && this.selectedNoteData.content_text == "") { LogUtil.info(TAG, "note is empty,save note failed") } diff --git a/features/src/main/ets/components/NoteContentCompPortrait.ets b/features/src/main/ets/components/NoteContentCompPortrait.ets index e5ef28d..f7cf8c9 100644 --- a/features/src/main/ets/components/NoteContentCompPortrait.ets +++ b/features/src/main/ets/components/NoteContentCompPortrait.ets @@ -616,6 +616,7 @@ export struct ToolBarComp { // 保存笔记信息到数据库 this.controllerShow.runJavaScript("getHtmlContent()") this.editModel = false + this.controllerShow.runJavaScript("javascript:RICH_EDITOR.getBlur()") } catch (error) { LogUtil.info(TAG, 'tick_thin error') }