-
Notifications
You must be signed in to change notification settings - Fork 6.8k
MdAutocomplete Throws error on dynamic focus #4844
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
Comments
It's throwing because you're trying to open the autocomplete too early. It'll work if you focus the input in |
…a panel Adds a more informative error if the user tries to open an autocomplete that doesn't exist or hasn't been defined yet by the `@ViewChild` query. Fixes angular#4844.
…a panel Adds a more informative error if the user tries to open an autocomplete that doesn't exist or hasn't been defined yet by the `@ViewChild` query. Fixes angular#4844.
I'm having the same issue. This only happens on iPad. I haven't had this on other platforms. Any fixes apart the one above? I did try it but doesn't work. |
Hi Everyone, I am facing problem in matautocompletetrigger while using matautocomplete in viewchild in jasmine typescript code is working fine. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug: The MdAutocomplete throws the error
When I try to dynamically focus the textbox using
ElementRef
ngOnInit() {
this.elementRef.nativeElement.querySelector('feed-header input#search').focus();
}
What is the expected behavior?
The MdAutocomplete should not crash when the focus is brought to the application.
What is the current behavior?
The MdAutocomplete crashes the application with the above stack trace
What are the steps to reproduce?
Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: https://goo.gl/DlHd6U
http://plnkr.co/edit/4gdaiKeAon2ziXJ9AOd1
What is the use-case or motivation for changing an existing behavior?
This is the common use case for the application to have the dynamic focus when the a
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular v4.0.0
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: