ngx-smart-modal icon indicating copy to clipboard operation
ngx-smart-modal copied to clipboard

IE11 can't do getModal() by identifier

Open kstamatov85 opened this issue 5 years ago • 4 comments

I'm submitting a ... (check one with "x")

[ x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior

for IE11 browser when try to getModal() by identifier the browser throws an error. I'm runnig an Angular5 project and this issue occurs for

"ngx-smart-modal": "^7.2.1",

In my code: import { NgxSmartModalService } from 'ngx-smart-modal'; constructor( ... private ngxModal: NgxSmartModalService, ... ) this.ngxModal.getModal('actionModal')

when call that method the browser throws an Error

Reproduction of the problem

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Smart Modal version: 0.8.x
  • Angular version: 2.0.x
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

kstamatov85 avatar Nov 20 '19 09:11 kstamatov85

Hi @kstamatov85, did you activate polyfills in your project ?

khylias avatar Nov 20 '19 10:11 khylias

Yes, they are active. When I downgrade to "ngx-smart-modal": "7.1.1", the issue does not exists

kstamatov85 avatar Nov 20 '19 10:11 kstamatov85

I was have same issue with chrome then i just solve it by wrap the code inside setTimeout like

setTimeout(() => {
  this.modalService.open('modalId');
}, 0);

HatemAlhasani avatar Aug 05 '20 05:08 HatemAlhasani

Check the solution available there : https://github.com/maximelafarie/ngx-smart-modal/issues/240#issuecomment-566857685

Adding a setTimeout didn't resolve the case for me (in IE). Anyway adding the pollyfils seems to be the way to go, at least it permits to avoid adding patchs for IE all over the applicative code.

alc-1 avatar Aug 27 '20 09:08 alc-1