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

Typeahead dropdown not closed automatically when long clicking another typeahead and hovering an option #2711

Closed
m-da opened this issue Sep 13, 2018 · 1 comment

Comments

@m-da
Copy link

m-da commented Sep 13, 2018

Bug description:

You need to have 2 typeaheads that are set to expand on focus, like the "Open on focus" from the demo page: https://ng-bootstrap.github.io/#/components/typeahead/examples#focus

Click on the 1st one, it will expand the list of options, then click AND HOLD on the 2nd one, it will expand the list of options, move your mouse to hover any option of the 2nd one, then release the click. Both typeaheads are now open at the same time, and you can hover any option of both. Clicking anywhere will close both of them. Works with any number of typeaheads that open on focus (3 on my plunkr below).

2018-09-13 10_33_57-plunker

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/x8m6PzxW1MN2eZHr9NBC

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 6.1.0

ng-bootstrap: 3.2.0

Bootstrap: 4.0.0

@maxokorokov
Copy link
Member

Sorry for letting this slip through, the workaround here would be adding

<input #t="ngbTypeahead" (blur)="t.dismissPopup()" />

A better fix would be using mouseup instead of click. Will open a PR to fix this and perf issues caused by using (document) handler when there are many typeaheads on the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants