Closed rpacheco124 closed 9 months ago
The current behavior is expected behaviour for a combobox, especially when selecting multiple items or searching for something and hitting "enter", we don't want it to be closed.
Your point makes sense in a single-select scenario and would be good to have as a directive/attribute here, like [comboboxSettings]="{ single: true }"
or [closeOnSelect]
- That way we don't need to track emitted event to do anything manually, and the actual emission (if needed), can be taken from the FormControl's valueChanges stream (or with ngModelChanges, take your pick).
What do you think?
Hi @ajitzero
I understand your point, but this issue is because I am trying to replicate the code that is in the documentation, in the documentation the combobox closes when I select an option.
I'm not sure if in the first version the combobox will support multiple options, we would have to see how shadcn has it, if it has a special component for multiselect or if a combobox is used.
I like your idea, thanks for commenting.
This will be part of the next release!
Issue was addressed as part of releases: cli 0.0.1-alpha.334 & ui 0.0.1-alpha.321
Please provide the environment you discovered this bug in.
Angular CLI: 17.0.0 Node: 21.4.0 Package Manager: npm 10.2.4 OS: win32 x64
Which area/package is the issue in?
command and popover
Description
I am trying to replicate the code published at spartan-ui/combobox in a new project. These are the steps I followed:
NOTE HERE -> the command to generate the command primitive does not install the "@ngneat/cmdk" dependency, and the "@ng-icons/radix-icons" dependency is also not installed. I had to manually install these dependencies.
I copy and paste the example code for the combobox, and everything seems to work fine. However, when I click on some of the combobox options, it does not close. To close it, I have to click outside the combobox.
Please provide the exception or error you saw
No response
Other information
No response
I would be willing to submit a PR to fix this issue