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

AutoComplete panel opened with dropdown does not hide when clicked outside #4162

Closed
QuanticRain opened this issue Oct 12, 2017 · 12 comments
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@QuanticRain
Copy link

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")

[x ] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

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.

@markovicboban
Copy link

I have the same problem...

@zlipps
Copy link

zlipps commented Oct 18, 2017

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.

@zlipps
Copy link

zlipps commented Oct 18, 2017

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.

Plunker: http://plnkr.co/edit/gOCEDoYor9YZ8pJd3KLM?p=info

@reinpeter
Copy link

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.
Thx @IsItBroken.

@reinpeter
Copy link

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

@cagataycivici cagataycivici self-assigned this Oct 19, 2017
@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working Status: Pending Review Issue or pull request is being reviewed by Core Team labels Oct 19, 2017
@cagataycivici cagataycivici added this to the 4.2.3 milestone Oct 19, 2017
@cagataycivici
Copy link
Member

Review multiSelect as well

@cagataycivici
Copy link
Member

Can it be replicated on showcase as well?

https://www.primefaces.org/primeng/#/autocomplete

@reinpeter
Copy link

For me not reproduceable on showcase, since it does not use async complete method there i think.

@Ketec
Copy link

Ketec commented Oct 20, 2017

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?

@cagataycivici cagataycivici changed the title <p-autoComplete> 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. AutoComplete panel opened with dropdown does not hide when clicked outside Oct 24, 2017
@cagataycivici cagataycivici added confirmed and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Oct 24, 2017
@cagataycivici
Copy link
Member

cagataycivici commented Oct 24, 2017

Replicated, happens on async case for sure.

@hardikBharadava
Copy link

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.

@yuerdev
Copy link

yuerdev commented Jul 9, 2018

add async set value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

8 participants