From 8b7010b591e2dfaf69837f9522b6e111af7d6dc9 Mon Sep 17 00:00:00 2001 From: wangzhiyusss Date: Mon, 30 Jan 2023 15:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E7=84=A6=E7=82=B9=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangzhiyusss --- features/src/main/ets/components/NoteListComp.ets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/features/src/main/ets/components/NoteListComp.ets b/features/src/main/ets/components/NoteListComp.ets index 00f6c0c..efe1d51 100644 --- a/features/src/main/ets/components/NoteListComp.ets +++ b/features/src/main/ets/components/NoteListComp.ets @@ -760,6 +760,7 @@ export struct SearchComp { .margin({ right: this.search ? 16 : 0 }) .visibility(this.search ? Visibility.Visible : Visibility.None) .onClick(() => { + focusControl.requestFocus('searchFocus') this.search = false // 退出键盘 // @ts-ignore @@ -769,6 +770,9 @@ export struct SearchComp { Flex({ justifyContent: FlexAlign.Start }) { Image($r('app.media.search')).width(20).height(20) + .focusable(true) + .key('searchFocus') + .defaultFocus(true) TextInput({ placeholder: $r('app.string.searchNote'), text: this.text }) .backgroundColor(this.longpress ? $r("app.color.search_longpress_bgcolor_f7f8f9") : $r("app.color.color_ffffff")) .caretColor($r("app.color.search_note_caret_color")) -- Gitee