diff --git a/templates/harmonyos-next/entry/src/main/ets/components/EditBoxDialog.ets b/templates/harmonyos-next/entry/src/main/ets/components/EditBoxDialog.ets index a8b8eb8ef7..921a7e67aa 100644 --- a/templates/harmonyos-next/entry/src/main/ets/components/EditBoxDialog.ets +++ b/templates/harmonyos-next/entry/src/main/ets/components/EditBoxDialog.ets @@ -57,6 +57,9 @@ export struct EditBoxDialog { .showUnderline(this.showInfo.showUnderline) .enterKeyType(this.showInfo.enterKeyType) .layoutWeight(1) + .onBlur(() => { + this.controller?.close(); + }) .onChange((value) => { this.showInfo.defaultMessage = value; this.workPort?.postMessage('onTextInput', value);