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 throws error in 2.0.0-beta.5 #4555

Closed
jitsk opened this issue May 15, 2017 · 3 comments · Fixed by #4573
Closed

Autocomplete throws error in 2.0.0-beta.5 #4555

jitsk opened this issue May 15, 2017 · 3 comments · Fixed by #4573
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@jitsk
Copy link

jitsk commented May 15, 2017

Bug, feature request, or proposal:

Bug

What is the expected behavior?

User must be able to type in the input and based on input autocomplete must appear.

What is the current behavior?

When user clicks in the input field, error is thrown and UI halts, i.e md-autocomplete option is shown but on click nothing happens. The error in console is:
Uncaught TypeError: Cannot read property '_elementRef' of null at material.es5.js:19969 at FilterSubscriber._next (filter.js:81) at FilterSubscriber.Subscriber.next (Subscriber.js:89) at HTMLDocument.handler (FromEventObservable.js:134) at ZoneDelegate.invokeTask (zone.js:414) at Zone.runTask (zone.js:181) at HTMLDocument.ZoneTask.invoke (zone.js:476)

What are the steps to reproduce?

Added an input field(not mdInput) and associated an autocomplete with it.

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

Angular: 4.0.1
Angular material: 2.0.0-beta.5
Not working in any of the browsers Tested in Firefox, Chrome ,IE11.

Is there anything else we should know?

Was working fine in material 2.0.0-beta.2 . I decided to change because autocomplete was not working in IE11(Issue 4258).
The input field is in a MdDialog.

@willshowell
Copy link
Contributor

Plunker? I suspect using mdInput is required, but not 100% on that

@crisbeto
Copy link
Member

mdInput shouldn't be required @willshowell, but it looks like I missed a null check in #3188.

@crisbeto crisbeto self-assigned this May 15, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue May 15, 2017
Fixes an error that was being thrown if `md-autocomplete` is used on an input that's not a part of an `md-input-container`.

Fixes angular#4555.
@kara kara added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label May 15, 2017
jelbourn pushed a commit that referenced this issue May 17, 2017
…ut (#4573)

Fixes an error that was being thrown if `md-autocomplete` is used on an input that's not a part of an `md-input-container`.

Fixes #4555.
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants