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

mat-select throw an error after option selected #8213

Closed
iceekey opened this issue Nov 3, 2017 · 5 comments
Closed

mat-select throw an error after option selected #8213

iceekey opened this issue Nov 3, 2017 · 5 comments

Comments

@iceekey
Copy link

iceekey commented Nov 3, 2017

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?

  • Chrome, Linux (Solus Project)
  • Angular ^5.0.0
  • @angular/material ^2.0.0-beta.12
@iceekey iceekey changed the title mat-select trow error after option selected mat-select trow an error after option selected Nov 3, 2017
@iceekey iceekey changed the title mat-select trow an error after option selected mat-select throw an error after option selected Nov 3, 2017
@willshowell
Copy link
Contributor

See #7729

@iceekey
Copy link
Author

iceekey commented Nov 3, 2017

@willshowell So it's officially a bug. Is my options limited to wait for an update?

@willshowell
Copy link
Contributor

@iceekey You can,

  1. Wait for next release
  2. Use snapshot builds
  3. Downgrade core to 4.x

@iceekey
Copy link
Author

iceekey commented Nov 3, 2017

@willshowell Thank you for your reply!

@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants