carbon-components-angular icon indicating copy to clipboard operation
carbon-components-angular copied to clipboard

Combobox list is open after updating list automatically without any user interaction

Open badheshweta21 opened this issue 4 years ago • 3 comments

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:

  1. 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.
  2. 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

badheshweta21 avatar Dec 15 '20 16:12 badheshweta21

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?

zvonimirfras avatar Jan 12 '21 17:01 zvonimirfras

Checked this issue in version 3.35.5, still can be reproduced.

liuyiffan avatar Apr 11 '21 03:04 liuyiffan

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.

grenobnik avatar Jun 28 '21 13:06 grenobnik