Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

When multiple md-autcomplete on the same page, md-not-found doesn't work #5865

Closed
IvanLeonenko opened this issue Nov 21, 2015 · 7 comments
Closed
Labels
P1: urgent Urgent issues that should be addressed in the next minor or patch release. pr: merge ready This PR is ready for a caretaker to review

Comments

@IvanLeonenko
Copy link

I'm using rc-4 and when I have multiple md-autocomplete with one of them having md-not-found defined (as in demo) on one page, it never shows up. If I have only one md-autocomplete, I see this item in the list, it works fine.
Also it looks like on demo page you don't have such issue, but I'm using same JS code and layout.

@devversion
Copy link
Member

Hmm, there must be something different. Can you share your exact code with us (codepen or something like that). Then we can investigate much better.

I tried to build a codepen, which shows your named issue.
http://codepen.io/DevVersion/pen/rObJEK?editors=101

Everything is working fine here, please take a look at your searchText and the other attributes.

@IvanLeonenko
Copy link
Author

Ok, it's a bit trickier,
If you have first autocomplete with not found template, and after it you have another one without not found template, then first autocomplete won't show not found item in the list, when it should.

Here take a look. (of cause they're bound to the same fields, but it doesn't matter, if you put not found template in both or change the order problem disappears):
http://plnkr.co/edit/KRCN2xYo0kNyoDOGgugm?p=preview

@devversion
Copy link
Member

Okay, I know how where the bug is, I will upload a fix in a few minutes... I have some connectivity problems

devversion added a commit to devversion/material that referenced this issue Nov 21, 2015
As before, the `hasNotFoundTemplate` Boolean was stored in the directive function so its used by all `autocomplete` directives, and that's wrong

Fixes angular#5865
devversion added a commit to devversion/material that referenced this issue Nov 21, 2015
As before, the `hasNotFoundTemplate` Boolean was stored in the directive function so its used by all `autocomplete` directives, and that's wrong

Fixes angular#5865
@kapilbhalala
Copy link

i found solution.
http://plnkr.co/edit/abhcwfN48lFvpMbocgLY?p=preview

@devversion
Copy link
Member

@KapilParam That's a solution we don't need. We wan't to remove the md-not-found template on one autocomplete. But then the Template won't show on both.

My PR is fixing this already. (pending for being merged)

@kapilbhalala
Copy link

please check this again
http://plnkr.co/edit/abhcwfN48lFvpMbocgLY?p=preview

@ThomasBurleson ThomasBurleson added pr: merge ready This PR is ready for a caretaker to review P1: urgent Urgent issues that should be addressed in the next minor or patch release. labels Jan 14, 2016
@ThomasBurleson
Copy link
Contributor

@robertmesserle - can you review the PR plz

@ThomasBurleson ThomasBurleson modified the milestone: Backlog Jan 14, 2016
ThomasBurleson pushed a commit that referenced this issue Feb 1, 2016
As before, the `hasNotFoundTemplate` Boolean was stored in the directive function so its used by all `autocomplete` directives, and that's wrong

Fixes #5865

  Closes #5867
ErinCoughlan pushed a commit to ErinCoughlan/material that referenced this issue Feb 9, 2016
As before, the `hasNotFoundTemplate` Boolean was stored in the directive function so its used by all `autocomplete` directives, and that's wrong

Fixes angular#5865

Closes angular#5867
@Splaktar Splaktar removed this from the - Backlog milestone Feb 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1: urgent Urgent issues that should be addressed in the next minor or patch release. pr: merge ready This PR is ready for a caretaker to review
Projects
None yet
Development

No branches or pull requests

6 participants