question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mat-select throw an error after option selected

See original GitHub issue

Bug, 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?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
willshowellcommented, Nov 3, 2017

@iceekey You can,

  1. Wait for next release
  2. Use snapshot builds
  3. Downgrade core to 4.x
0reactions
angular-automatic-lock-bot[bot]commented, Sep 7, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found