Skip to content

md-autocomplete error when using *ngIf in md-input-container #3269

Closed

Description

@Poledouris

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Drop down shows and no error is thrown

What is the current behavior?

Drop down is not shown, and an error is thrown in Chrome Dev Tools:

  • "Cannot read property 'toArray' of undefined"

What are the steps to reproduce?

Inside the md-input-container tag include an *ngIf directive
Plunker based off Material Example for Autocomplete:
https://plnkr.co/edit/AYx6dvqxMARf3WcgrX6x?p=preview

What is the use-case or motivation for changing an existing behavior?

It should work

Which versions of Angular, Material, OS, browsers are affected?

Angular 2.4.8, Material Beta 2

Is there anything else we should know?

I have found a couple workarounds, but neither are ideal:

  • put the *ngIf directive in a span around the md-input-control (shouldn't be necessary)
  • put the md-autocomplete into the md-input-container (if this is the proper solution, I think demos should be updated and implemented in this manner.)

Activity

  1. self-assigned this
    on Feb 23, 2017
  2. added
    cannot reproduce
    P2
    and removed
    cannot reproduce
    on Feb 23, 2017
  3. angular-automatic-lock-bot commented on Sep 5, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  4. locked and limited conversation to collaborators on Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions