Skip to content

Commit

Permalink
feat(FilterableMultiSelect): assign given id to the listbox
Browse files Browse the repository at this point in the history
Pass the existing `id` prop to the rendered `ListBox` for parity
with `MultiSelect`.
  • Loading branch information
cuppajoey authored and Joseph Schultz committed Jul 5, 2024
1 parent 77aa024 commit abb0188
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,7 @@ const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect<
disabled={disabled}
light={light}
ref={ref}
id={id}
invalid={invalid}
invalidText={invalidText}
warn={warn}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,11 @@ describe('FilterableMultiSelect', () => {
`${prefix}--list-box__wrapper--slug`
);
});

it('should place the given id on the listbox wrapper', async () => {
render(<FilterableMultiSelect {...mockProps} id="custom-id" />);
await waitForPosition();

expect(document.querySelector(`.${prefix}--list-box`).id).toBe('custom-id');
});
});

0 comments on commit abb0188

Please sign in to comment.