!30873 修改SelectDialog内容区走焦规则

Merge pull request !30873 from zhangwenbin00001/dialogPr
This commit is contained in:
openharmony_ci 2024-04-18 09:07:03 +00:00 committed by Gitee
commit b7c3c0f3a1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 8 additions and 4 deletions

View File

@ -678,8 +678,10 @@ export class SelectDialog extends ViewPU {
List.width('100%');
List.clip(false);
List.onFocus(() => {
this.contentScroller.scrollEdge(Edge.Top);
focusControl.requestFocus(String(FIRST_ITEM_INDEX));
if (!this.contentScroller.isAtEnd()) {
this.contentScroller.scrollEdge(Edge.Top);
focusControl.requestFocus(String(FIRST_ITEM_INDEX));
}
});
List.defaultFocus(this.buttons?.length == 0 ? true : false);
if (!q14) {

View File

@ -344,8 +344,10 @@ export struct SelectDialog{
})
}.width('100%').clip(false)
.onFocus(() => {
this.contentScroller.scrollEdge(Edge.Top);
focusControl.requestFocus(String(FIRST_ITEM_INDEX));
if (!this.contentScroller.isAtEnd()) {
this.contentScroller.scrollEdge(Edge.Top);
focusControl.requestFocus(String(FIRST_ITEM_INDEX));
}
})
.defaultFocus(this.buttons?.length == 0 ? true : false)
}