mat-select throw an error after option selected
See original GitHub issueBug, feature request, or proposal:
index.d.ts.MatSelect.html:1 ERROR TypeError: Cannot read property 'nativeElement' of undefined
at MatSelect._onFadeInDone (select.es5.js:744)
at Object.eval [as handleEvent] (index.d.ts.MatSelect.html:1)
at handleEvent (core.js:13254)
at callWithDebugContext (core.js:14739)
at Object.debugHandleEvent [as handleEvent] (core.js:14326)
at dispatchEvent (core.js:9703)
at eval (core.js:10317)
at eval (animations.js:348)
at Array.forEach (<anonymous>)
at eval (animations.js:346)
<mat-select [ngModel]="language" (change)="switchLanguage($event)"
placeholder="{{'app.language'|translate}}" name="lang">
<mat-option *ngFor="let lang of languages" [value]="lang.locale">
{{lang.name}}
</mat-option>
</mat-select>
MatSelect.prototype._onFadeInDone = function () {
this._panelDoneAnimating = this.panelOpen;
this.panel.nativeElement.focus(); // <-- ERROR IS HAPPENING HERE
this._changeDetectorRef.markForCheck();
};
After update this error appeared. Everything works fine, just the error and small animation glitch when overlap panel fading out. Idk what to do with this error and how to fix it. Code looks pretty standard…
What is the current behavior?
- Chrome, Linux (Solus Project)
- Angular ^5.0.0
- @angular/material ^2.0.0-beta.12
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Getting an error while using angular material mat-select with ...
You should use formControlName in mat-select not in mat-option. <mat-form-field> <mat-select placeholder="Unit Type" ...
Read more >Select | Angular Material
<mat-select> is a form control for selecting a value from a set of options, similar to the native <select> element. You can read...
Read more >mat select all option stackblitz - You.com | The AI Search ...
What is the current behavior? Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'null: '. Current ...
Read more >Angular Material Select Box - Lots Of Useful Options - YouTube
Angular filter Mat-Select based on another Mat-Select - 2022 · Angular Material Drag and Drop - Complete Step by Step Example · Angular ......
Read more >Angular Material Select - Javatpoint
The placeholder specifies by setting the placeholder attribute on the <mat-select> element. In some cases, that <mat-form-field> uses a placeholder as a label....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@iceekey You can,
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.