Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/uui-combobox-list/lib/uui-combobox-list.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,16 @@ export class UUIComboboxListElement extends LitElement {
break;
}

//Space key
case ' ': {
const el = e.target as HTMLInputElement;
console.log('FROM LIST', el.value);
e.preventDefault();
e.stopPropagation();
this._getActiveElement?.click();
break;
}

case 'End': {
e.preventDefault();
this._goToIndex(this._options.length - 1);
Expand Down
7 changes: 7 additions & 0 deletions packages/uui-combobox/lib/uui-combobox.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@ export class UUIComboboxElement extends UUIFormControlMixin(LitElement, '') {
this.#onOpen();
}

if (e.key === ' ') {
if (this._isOpen) return;
e.preventDefault();
e.stopImmediatePropagation();
this.#onOpen();
}

if (e.key === 'Escape' || e.key === 'Enter') {
this.#onClose();
}
Expand Down
Loading