-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
bug(MatAutocomplete): cannot read property 'nativeElement' of undefined #22511
Comments
Fixes an error that is thrown if a `keydown` event is dispatched before the autocomplete panel has been initialized. Fixes angular#22511.
@crisbeto thank you for taking this issue in work, is there any workaround for it? |
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. |
Reproduction
Here's StackBiz where you can reproduce error.
https://angular-ivy-uinb66.stackblitz.io
https://stackblitz.com/edit/angular-ivy-uinb66
Steps to reproduce:
Here's stacktrace of the error:
TypeError: Cannot read property 'nativeElement' of undefined at MatAutocompleteTrigger._scrollToOption (autocomplete.js:909) at MatAutocompleteTrigger._handleKeydown (autocomplete.js:605) at MatAutocompleteTrigger_keydown_HostBindingHandler (autocomplete.js:985) at executeListenerWithErrorHandling (core.js:15220) at wrapListenerIn_markDirtyAndPreventDefault (core.js:15255) at HTMLInputElement.<anonymous> (platform-browser.js:582) at ZoneDelegate.invokeTask (zone-evergreen.js:399) at Object.onInvokeTask (core.js:28522) at ZoneDelegate.invokeTask (zone-evergreen.js:398) at Zone.runTask (zone-evergreen.js:167)
Expected Behavior
No exception throwed.
Actual Behavior
TypeError: cannot read property 'nativeElement' of undefined
Environment
The text was updated successfully, but these errors were encountered: