fix onbackpress return type, fix note edit input method behavior

Signed-off-by: guozejun <guozejun@huawei.com>
This commit is contained in:
guozejun
2022-05-09 16:13:40 +08:00
parent 2eef5c4e0c
commit d6559afc11
2 changed files with 3 additions and 1 deletions
@@ -93,7 +93,7 @@ export struct MyNoteHomeComp {
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
}
onBackPress():void{
onBackPress() {
LogUtil.info(this.TAG, "onBackPress")
// 退出键盘
inputMethod.getInputMethodController().stopInput();
@@ -16,6 +16,7 @@
import {NoteContent} from '@ohos/component/src/main/ets/components/NoteContent'
import {LogUtil} from '@ohos/utils/src/main/ets/default/baseUtil/LogUtil'
import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil'
import inputMethod from '@ohos.inputmethod'
@Entry
@Component
@@ -40,6 +41,7 @@ struct NoteContentHome {
LogUtil.info(this.TAG, "onBackPress")
this.controllerShow.runJavaScript({ script: "RICH_EDITOR.setInputEnabled(false)" })
this.controllerShow.runJavaScript({ script: "get_html_content()" })
inputMethod.getInputMethodController().stopInput()
}
aboutToAppear(): void{