Skip to content

Commit

Permalink
fix(ui5-button): fix tab chaining in lists (#9148)
Browse files Browse the repository at this point in the history
[feat(ui5-menu-item): add endContent slot](#9077) PR introduces a regression in Tab chaining in lists because of improper marking of `keyup` event in `ui5-button` component. It was marked always but should be marked only if event is fired by Space key. In addition, there is redundant check in ListItemBase which is removed now.
  • Loading branch information
NHristov-sap authored Jun 7, 2024
1 parent efb4791 commit 9fdf617
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/main/src/Button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,10 @@ class Button extends UI5Element implements IButton, IFormElement {
if (this._cancelAction) {
e.preventDefault();
}
markEvent(e, "button");

if (isSpace(e)) {
markEvent(e, "button");
}

if (isSpace(e) || isEnter(e)) {
if (this.active) {
Expand Down
3 changes: 0 additions & 3 deletions packages/main/src/ListItemBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ class ListItemBase extends UI5Element implements ITabbable {
}

_onkeydown(e: KeyboardEvent) {
if (getEventMark(e) === "button") {
return;
}
if (isTabNext(e)) {
return this._handleTabNext(e);
}
Expand Down

0 comments on commit 9fdf617

Please sign in to comment.