Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/multiselect-open-on-focus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@easypost/easy-ui": minor
---

`MultiSelect` now opens its dropdown when the input receives focus, not only when the user types or clicks the arrow button.
6 changes: 6 additions & 0 deletions easy-ui-react/src/MultiSelect/MultiSelect.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ describe("<MultiSelect />", () => {
expect(screen.getByRole("listbox")).toBeInTheDocument();
});

it("should open dropdown when focusing the input", async () => {
const { user } = render(getMultiSelect());
await userClick(user, screen.getByRole("combobox"));
expect(screen.getByRole("listbox")).toBeInTheDocument();
});

it("should filter dropdown with input interaction", async () => {
const { user } = render(getMultiSelect());
await user.type(screen.getByRole("combobox"), "ban");
Expand Down
1 change: 1 addition & 0 deletions easy-ui-react/src/MultiSelect/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ export function MultiSelect<T extends Item>(props: MultiSelectProps<T>) {
<div className={styles.comboBoxContainer}>
<ComboBox
className={styles.comboBox}
menuTrigger="focus"
allowsEmptyCollection
aria-label="Available items"
selectedKey={tempSelectedKey}
Expand Down
Loading