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

fix(autocomplete): store hasNotFoundTemplate in shared element #5867

Closed

Conversation

devversion
Copy link
Member

As before, the hasNotFoundTemplate Boolean was stored in the directive function so its used by all autocomplete directives, and that's wrong

Fixes #5865

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
@ThomasBurleson ThomasBurleson added needs: review This PR is waiting on review from the team and removed needs: review This PR is waiting on review from the team labels Nov 24, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 1.0-rc7, 1.01 Nov 24, 2015
@EladBezalel
Copy link
Member

LGTM

@EladBezalel EladBezalel added pr: merge ready This PR is ready for a caretaker to review and removed needs: review This PR is waiting on review from the team labels Dec 31, 2015
@ThomasBurleson ThomasBurleson modified the milestones: 1.0.1, 1.0.2 Jan 5, 2016
@ThomasBurleson ThomasBurleson modified the milestones: 1.0.2, 1.0.5 Jan 30, 2016
ThomasBurleson pushed a commit that referenced this pull request 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
@skovalyov
Copy link

Apparently, it fails, if the <md-autocomplete> element is located inside another element, which visibility is controlled by ngIf directive. Then template() is being called first and hasNotFoundTemplate property is initialized with true, but then when link() is being called, hasNotFoundTemplate equals undefined. This happens due to the way how Angular processes the directive. Here is a Codepen: http://codepen.io/anon/pen/rxQOrq

@devversion
Copy link
Member Author

@skovalyov That's already a known issue. See #7035. And will be fixed in #7042.
Using an attribute will persist in the HTMLElement see MDN and tests.
Thanks for that codepen 👍

@skovalyov
Copy link

@devversion, great, thanks for update!

ErinCoughlan pushed a commit to ErinCoughlan/material that referenced this pull request 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
@devversion devversion deleted the fix/autocomplete-hasnotfound branch April 19, 2016 19:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants