Skip to content

Commit

Permalink
feat(FilterableMultiSelect): assign given id to the listbox (#16917)
Browse files Browse the repository at this point in the history
Pass the existing `id` prop to the rendered `ListBox` for parity
with `MultiSelect`.

Co-authored-by: Riddhi Bansal <41935566+riddhybansal@users.noreply.github.com>
  • Loading branch information
cuppajoey and riddhybansal committed Jul 26, 2024
1 parent 299e624 commit d755f2c
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 @@ -772,6 +772,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 d755f2c

Please sign in to comment.