Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Dropdowns:Click on 2nd Dropdown does not open it as the first Dropdown was open #313

Closed
SunilKumar5 opened this issue Mar 1, 2018 · 5 comments · Fixed by #465
Closed

Comments

@SunilKumar5
Copy link

Please fill below information if issuing a bug report.

Expected behaviour

When there are multiple drodpdowns on the same screen. First click on a dropdown opens options and clicking directly on other dropdown should have opened the second dropdown.

Actual behaviour

Now First click on a dropdown opens options and clicking directly on other dropdown closes the first dropdown options but does not open second dropdown options.
This can be found in the demo app also.

More Info

ng-select version: [0.24.0]

browser: [Chrome 64]

reproducible in demo page: [YES]

@anjmao
Copy link
Member

anjmao commented Mar 2, 2018

Hi @SunilKumar5 ,
We added technique like in angular material which adds overlay on whole page. This allows to easily close dropdown by clicking on overlay, so you don't need to listen to global document click events, but in your case it requires extra click. It is still working fine when using tabs navigation. I will keep this open for now and investigate possible solutions.

@anjmao
Copy link
Member

anjmao commented Mar 2, 2018

angular/components#10232

@varnastadeus
Copy link
Member

@anjmao @SunilKumar5 native html select works this way so I am perfectly fine with this behaviour.

@anjmao
Copy link
Member

anjmao commented Mar 2, 2018

@varnastadeus If native html sucks it doesn't mean what we also should.

@anjmao anjmao added this to the Version 2.0.0 milestone Mar 16, 2018
@anjmao anjmao modified the milestones: Version 2.0.0, Version 1.0.0 Mar 20, 2018
@anjmao
Copy link
Member

anjmao commented Mar 20, 2018

I looked at some popular select components and they all handle dropdown closing without overlay. Will need to fix this behaviour.

anjmao added a commit that referenced this issue Apr 17, 2018
fixes #453 
fixes #313 

Previously ng-select dropdown close was handled by clicking on invisible overlay, but it causes some issues. This approach uses global document mousedown event listener to determine when to close dropdown.
jakemdunn pushed a commit to jakemdunn/ng-select that referenced this issue Oct 16, 2018
fixes ng-select#453 
fixes ng-select#313 

Previously ng-select dropdown close was handled by clicking on invisible overlay, but it causes some issues. This approach uses global document mousedown event listener to determine when to close dropdown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants