mirror of
https://gitee.com/openharmony/applications_notes
synced 2024-11-23 15:39:50 +00:00
适配焦点问题
Signed-off-by: wangzhiyusss <wangzhiyu12@huawei.com>
This commit is contained in:
parent
b1ee60b3d6
commit
8b7010b591
@ -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"))
|
||||
|
Loading…
Reference in New Issue
Block a user