Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui5-list): focus list on non-focusable child click #10124

Merged
merged 7 commits into from
Dec 16, 2024
2 changes: 1 addition & 1 deletion packages/main/src/Avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class Avatar extends UI5Element implements ITabbable, IAvatarGroupItem {
if (this.forcedTabIndex) {
return parseInt(this.forcedTabIndex);
}
return this._interactive ? 0 : -1;
return this._interactive ? 0 : undefined;
}

/**
Expand Down
3 changes: 3 additions & 0 deletions packages/main/src/ListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ abstract class ListItem extends ListItemBase {
return;
}
super.fireItemPress(e);
if (document.activeElement !== this) {
this.focus();
}
}

get isInactive() {
Expand Down
1 change: 0 additions & 1 deletion packages/main/src/ListItemBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ class ListItemBase extends UI5Element implements ITabbable {
if (this.getFocusDomRef()!.matches(":has(:focus-within)")) {
return;
}

this.fireItemPress(e);
}

Expand Down
Loading