Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@mantine/core] Combobox: Fix #5427 #5509

Merged
merged 5 commits into from
Jan 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/@mantine/core/src/components/Combobox/Combobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export function Combobox(_props: ComboboxProps) {
store: controlledStore,
vars,
onOptionSubmit,
onClose,
size,
dropdownPadding,
resetSelectionOnOptionHover,
Expand Down Expand Up @@ -159,7 +160,7 @@ export function Combobox(_props: ComboboxProps) {
<Popover
opened={store.dropdownOpened}
{...others}
onClose={store.closeDropdown}
onClose={onClose || store.closeDropdown}
Copy link
Member

Choose a reason for hiding this comment

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

I suppose that it would be better to call both functions:

() => {onClose?.(); store.closeDropdown()}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree it's a good idea to call both functions. I've updated it to trigger both close handlers

withRoles={false}
unstyled={unstyled}
>
Expand Down