Skip to content

Commit

Permalink
add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Oct 20, 2024
1 parent 9e3a175 commit ba7c552
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-owls-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": patch
---

Allow `Select` to be opened with the `Enter` key.
9 changes: 6 additions & 3 deletions packages/bits-ui/src/lib/bits/select/select.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,12 @@ class SelectTriggerState {
if (e.key === kbd.ARROW_UP || e.key === kbd.ARROW_DOWN) e.preventDefault();

if (!this.root.open.current) {
if (e.key === kbd.ENTER) {
return;
} else if (e.key === kbd.SPACE || e.key === kbd.ARROW_DOWN || e.key === kbd.ARROW_UP) {
if (
e.key === kbd.ENTER ||
e.key === kbd.SPACE ||
e.key === kbd.ARROW_DOWN ||
e.key === kbd.ARROW_UP
) {
e.preventDefault();
this.root.handleOpen();
} else if (!this.root.isMulti && this.root.dataTypeaheadEnabled) {
Expand Down

0 comments on commit ba7c552

Please sign in to comment.