components icon indicating copy to clipboard operation
components copied to clipboard

mat-select on 8 does not emit openedChange Event on IE 11

Open kschwidder opened this issue 7 years ago • 12 comments

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/fork/components-issue

Steps to reproduce:

  1. Migrating to angular 8 with target "es5"
  2. Running the generated app in CHROME shows openedChange Event either true or false correctly
  3. Running under IE 11 only shows first time true and than nothing
  4. Works properly under angular 7.2.15 and material 7.3.7 before

Expected Behavior

What behavior were you expecting to see?

Chrome: mat-select emits "openedChange" event properly if opened or closed. IE 11: mat-select should emit "openedChange" event if opened or closed too (as provided in 7.3.7)

Actual Behavior

What behavior did you actually see?

Chrome: mat-select properly emits the "openedChange" events IE11: mat-select only emits once "openedChange" event when opening. Further closing and opening the mat-select item DOES NOT emit any events anymore.

Environment

  • Angular: 8.0.0
  • CDK/Material: 8.0.0
  • Browser(s): IE 11 and CHROME (latest)
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows, MacOS

kschwidder avatar Jun 03 '19 14:06 kschwidder

I wasn't able to reproduce it in our dev app like this:

<mat-form-field>
  <mat-label>Drink</mat-label>
  <mat-select [(ngModel)]="currentDrink" (openedChange)="log($event)">
    <mat-option>None</mat-option>
    <mat-option *ngFor="let drink of drinks" [value]="drink.value" [disabled]="drink.disabled">
      {{ drink.viewValue }}
    </mat-option>
  </mat-select>
</mat-form-field>

crisbeto avatar Jun 04 '19 19:06 crisbeto

https://stackblitz.com/edit/angular-etc4r1?file=app/select-multiple-example.html

can not run this in IE 11 on client side. Created your example and IE does not perform properly as described.

Hope you can fix it.

Package.json

"@angular-devkit/build-angular": "~0.800.0",
"@angular/animations": "8.0.0",
"@angular/cdk": "8.0.0",
"@angular/common": "8.0.0",
"@angular/compiler": "8.0.0",
"@angular/core": "8.0.0",
"@angular/flex-layout": "8.0.0-beta.26",
"@angular/forms": "8.0.0",
"@angular/material": "8.0.0",
"@angular/platform-browser": "8.0.0",
"@angular/platform-browser-dynamic": "8.0.0",
"@angular/pwa": "^0.800.1",
"@angular/router": "8.0.0",
"@angular/service-worker": "8.0.0",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"@swimlane/ngx-charts": "^11.1.0",
"core-js": "^3.1.3",
"hammerjs": "^2.0.8",
"help": "^3.0.2",
"lodash": "^4.17.11",
"material-design-icons": "^3.0.1",
"moment": "^2.24.0",
"node-sass": "^4.12.0",
"rxjs": "6.5.2",
"tslib": "^1.9.0",
"web-animations-js": "^2.3.1",
"xlsx": "^0.14.3",
"zone.js": "~0.9.1"

kschwidder avatar Jun 05 '19 14:06 kschwidder

I was able to reproduce it in our dev app like this:

<mat-form-field>
  <mat-label>Drink</mat-label>
  <mat-select [(ngModel)]="currentDrink" (openedChange)="log($event)">
    <mat-option>None</mat-option>
    <mat-option *ngFor="let drink of drinks" [value]="drink.value" [disabled]="drink.disabled">
      {{ drink.viewValue }}
    </mat-option>
  </mat-select>
</mat-form-field>

I have tried to debug the issue down but I am stucked. Could it be that zone.js is causing the problem ? I am blocked to bring the version life since IE11 is a must... The label "cannot reproduce" should be changed too. Cheers Kai

kschwidder avatar Jun 06 '19 09:06 kschwidder

@crisbeto: Any news about this topic ?

kschwidder avatar Jun 11 '19 14:06 kschwidder

@crisbeto you are able to reproduce? I see you added cannot reproduce label

mmalerba avatar Jun 12 '19 16:06 mmalerba

@crisbeto,

I'm running into this issue as well, it looks like it has been mislabeled.

Angular Material 8 in IE11 does not emit the openedChange event.

If it helps, in my project I'm specifically using the NoopAnimationModule for IE11.

christopher-kiss avatar Jul 05 '19 02:07 christopher-kiss

@ChristopherKiss Should we raise an issue at angular.io if it is a pure angular 8 issue ?

In addition: Does the NoopAnimationModule fixes the issue für IE 11. Does it impacts the animation for chrome etc. ? We have an app that runs on IE11 and chrome/firefox served via es5 and es2018 by angular 8.

kschwidder avatar Jul 12 '19 06:07 kschwidder

@kschwidder,

I meant Angular material 8 (I'll update my previous comment). I'm not sure where the issue exactly lies.

Using the NoopAnimationModule does not fix the issue for IE11, I specifically only load the NoopAnimationModule for IE11 and not Chrome so won't affect those. I only mentioned this in case it was relevant.

I have the same setup as you, I think the issue is that IE11 is having issues with the animation being completed.

We can see that the openClose event is emitted based on: _panelDoneAnimatingStream https://github.com/angular/components/blob/master/src/material/select/select.ts#L524

This emitted from the html: https://github.com/angular/components/blob/9eeb4b5aa0473c0815a73bfe3c2ed6164d86a3b3/src/material/select/select.html#L38

Of which the animation is here: https://github.com/angular/components/blob/9eeb4b5aa0473c0815a73bfe3c2ed6164d86a3b3/src/material/select/select-animations.ts

Not sure what part specifically isn't working in IE11.

christopher-kiss avatar Jul 12 '19 07:07 christopher-kiss

After digging some more, looks like the issue isn't that done isn't firing, but that it's firing twice. (I haven't tested this myself), but this looks like a core Angular bug rather than an Angular Material bug.

https://github.com/angular/angular/issues/24084

christopher-kiss avatar Jul 16 '19 22:07 christopher-kiss

@crisbeto This is kind of a big issue for my team and our ability to use angular material and support IE11. I am encountering the same behavior where you can not hook into the openedChange event. I am using v7 of Angular and Angular Material. Would updating to V8 fix this issue?

Reading the OP description maybe I should downgrade to Works properly under angular 7.2.15 and material 7.3.7 before???

WillGeller avatar Nov 01 '19 21:11 WillGeller

Closing this issue because Angular is dropping support for IE11 in the upcoming version 13. We don't plan to fix any further IE11 bugs going forward.

jelbourn avatar Jul 29 '21 00:07 jelbourn

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.