carbon-components-angular
carbon-components-angular copied to clipboard
Combobox list is open after updating list automatically without any user interaction
Detailed description
After updating items of combobox list, the combobox dropdown list is open automatically without any user interaction
https://angular.carbondesignsystem.com/?path=/story/components-combobox--basic
carbon components version : ^4.27.1
here I using combobox with default selected value. the dropdown is loaded using api data. so whenever api call is happening and data is loaded then it is showing dropdown list.
for reproducing this issue:
just add the items in settimeout with some specific time i used 1000ms. set one of the item as selected: true. and try to load page.
items: [
{
content: "one"
},
{
content: "two"
},
{
content: "three",
selected: true
},
{
content: "four"
}
],
I assigned this object to items inside setTimeout.
More information:
- If you update one of the items to be selected with a setTimeout then the combobox gets focus. If its updated programmatically like this we shouldn’t focus.
- In combobox If you go to “Basic” and type in a filter search such as “aaaa” you see all results, but you should see none. If you go to “Multi-select” and do same “aaaa” search you get no results. Should be consistent
I couldn't replicate it by changing items in knobs in the latest (4.36.1). Do you still have the same problem? If so, can you provide a reproduction?
Checked this issue in version 3.35.5, still can be reproduced.
I had the same issue. It is still there with the latest version 4.53.3. So, when I want o update items in combobox, I pass first the empty list []
and then the new data. This way the combobox stay closed. But indeed, this is a very annoying behavior.