Combobox filter behaviour can be improved. #2674
Replies: 2 comments
-
Correct! This is a design decision. The filtering logic should be handled by default in the userland code. Feel free to use https://github.com/chakra-ui/atlas/blob/9f0ca36760af158c2e3ca6dc9faeb5360734ce36/website/src/demos/combobox.demo.tsx as a guide. Even in Headless UI, you can see the filtering is handled by the userland code |
Beta Was this translation helpful? Give feedback.
-
@segunadebayo I think the examples on https://ark-ui.com/react/docs/components/combobox should be a bit more clear. e.g. In the Demo, we see that the results are filtered, but on the sample code, there is no filtering so it makes developers assume that it's handled somewhere lower level. This is because, for example https://github.com/pacocoursey/cmdk does it implicitly. I assumed that it was the same here but doesn't seem to be. Would've just been nice for it to be clearer. Otherwise, thanks for the library! |
Beta Was this translation helpful? Give feedback.
-
Okay, first of all, thanks a lot for creating a beautiful library of unstyled components, it's been a blessing to integrate it in our design system so far.
I was working on the Combobox component and noticed that the list is not filtered by default on input value.
Minimal repro - https://stackblitz.com/edit/vitejs-vite-g1vovc?file=src%2FApp.tsx
Now, I've seen a lot of other Combobox primitives, where filtering is there out of the box.
For example, Headless UI's combobox and React Aria Components to name a couple.
Is it intented to manage the filteration manually? this can surely be improved in my humble opinion.
This behaviour is also mentioned in the W3C specs.
Beta Was this translation helpful? Give feedback.
All reactions