diff --git a/packages/main/src/ListItem.ts b/packages/main/src/ListItem.ts index 8abc673e4c8..71648982c85 100644 --- a/packages/main/src/ListItem.ts +++ b/packages/main/src/ListItem.ts @@ -254,6 +254,10 @@ abstract class ListItem extends ListItemBase { } async _onkeydown(e: KeyboardEvent) { + if ((isSpace(e) || isEnter(e)) && this._isTargetSelfFocusDomRef(e)) { + return; + } + super._onkeydown(e); const itemActive = this.type === ListItemType.Active, @@ -328,6 +332,13 @@ abstract class ListItem extends ListItemBase { } } + _isTargetSelfFocusDomRef(e: KeyboardEvent): boolean { + const target = e.target as HTMLElement, + focusDomRef = this.getFocusDomRef(); + + return target !== focusDomRef; + } + /** * Called when selection components in Single (ui5-radio-button) * and Multi (ui5-checkbox) selection modes are used.