Skip to content

Commit

Permalink
fix(combobox): combobox was closing on clearing input
Browse files Browse the repository at this point in the history
  • Loading branch information
Powerplex committed Mar 27, 2024
1 parent 31e2985 commit b72728a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/components/combobox/src/Combobox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -941,9 +941,12 @@ export const ModalSearch: StoryFn = () => {
} else {
const [_, id] = value.split('-')
const book = books.find(({ id: bookId }) => `${bookId}` === id)
setValue(book ? book?.name : undefined)

if (book) {
setValue(book?.name)
setIsOpen(false)
}
}
setIsOpen(false)
}}
defaultValue={value}
>
Expand All @@ -959,7 +962,6 @@ export const ModalSearch: StoryFn = () => {
aria-label={'Clear input'}
onClick={() => {
setIsOpen(true)
debugger
}}
/>
</Combobox.Trigger>
Expand Down

0 comments on commit b72728a

Please sign in to comment.