Skip to content

Commit

Permalink
focus and select text in combobox when list is opened (#1610)
Browse files Browse the repository at this point in the history
  • Loading branch information
rossedfort authored Aug 31, 2023
1 parent f4e73d9 commit 9f27c3c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/holocene/combobox/combobox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@
closeList();
} else {
openList();
inputElement.focus();
}
};
const openList = () => {
$open = true;
inputElement.focus();
inputElement.select();
};
const closeList = () => {
Expand Down Expand Up @@ -288,7 +289,7 @@
on:click={toggleList}
>
<Icon name={$open ? 'chevron-up' : 'chevron-down'} />
</button>
</button>
</div>

<Menu bind:menuElement id="{id}-listbox" role="listbox" class="w-full">
Expand Down

1 comment on commit 9f27c3c

@vercel
Copy link

@vercel vercel bot commented on 9f27c3c Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

holocene – ./

holocene.preview.thundergun.io
holocene-git-main.preview.thundergun.io

Please sign in to comment.