-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
AutoComplete panel opened with dropdown does not hide when clicked outside #4162
Comments
I have the same problem... |
I am also seeing this issue after upgrading to 4.2.1. Looks like the dropdownClick variable is still set to true when an item from the suggestions is selected the first time which is preventing hide from being called. |
Created a Plunker showing the issue. After some research I found it only happens when the drop down button is clicked, it works fine when typing into auto complete box, and there is an async action in the complete method. |
Same problem here, i could not reproduce it so far outside of our project in a plkr, but the async in complete method is the key apparently! This is quite common i would say. |
analyzing the code: the documentclicklistener which sets the dropdownclick flag to false, is only bound on the show method, which is to late in the case of async complete |
Review multiSelect as well |
Can it be replicated on showcase as well? |
For me not reproduceable on showcase, since it does not use async complete method there i think. |
Showcase has one issue - open dropdown, click anywhere else (do not select anything) - and it wont close. Similar close issue also shows up if you have it attached to body and router navigates somewhere else - dropdown remains open and wont close until you navigate back to the component where the dropdown is. Perhaps using focus/focusout to close it might be more reliable than outsideclick alone? |
Replicated, happens on async case for sure. |
It still happening on V4.3.0, when we are using 2 Auto complete, Open dropdown for One using Button, and do nothing just open another Dropdown using button, it will opens dropdown panel for both auto complete. |
add async set value |
There is no guarantee in receiving a response in GitHub Issue Tracker, If you'd like to secure our response, you may consider PrimeNG PRO Support where support is provided within 4 business hours
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.
http://plnkr.co/edit/6q5v84DWolH6DeAdi70w?p=preview
Current behavior
PrimeNg: 4.2.2
does not close drop down listing after selecting an item from the drop down list. You must either click out of the control or click the item twice in order to get the drop down list to go away.
Expected behavior
<p-autoComplete should close drop down listing after selecting an item from the drop down list.
It works as expected in version 4.1.2
Minimal reproduction of the problem with instructions
Use any version greater than 4.2.*, use the <p-autoComplete and the drop down list does not close after selecting an item.
What is the motivation / use case for changing the behavior?
I'd like it to work like it does in version 4.1.*.
Please tell us about your environment:
Windows, NPM, Angular 4.
Angular version: 2.0.X
Angular 4.* , angular version does not cause the issue.
PrimeNG version: 2.0.X
Broken in version 4.2.2, works fine in version 4.1.2
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Reproducible in Chrome and IE.
Language: [all | TypeScript X.X | ES6/7 | ES5]
TypeScript any version does not have any impact.
Node (for AoT issues):
node --version
=No AOT work.
The text was updated successfully, but these errors were encountered: