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

IE 11 中在A标签上打开modal 窗口出错 #2388

Closed
kkalpha opened this issue Nov 1, 2018 · 12 comments
Closed

IE 11 中在A标签上打开modal 窗口出错 #2388

kkalpha opened this issue Nov 1, 2018 · 12 comments

Comments

@kkalpha
Copy link

kkalpha commented Nov 1, 2018

Version

1.8.0

Environment

IE 11

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-start-y5nxnf

Steps to reproduce

  1. 在A标签上的click事件打开modal,代码如 <a class="action-button" (click)="addEmployee()">
  2. addEmployee的代码如: const modal = this.modalService.create({
    nzTitle: '',
    nzContent: EmployeeListComponent,
    nzComponentParams: {
    selectedEmployees: '1'
    },
    nzWidth: '700px',
    nzClosable: false,
    nzFooter: null
    });

What is expected?

正常打开

What is actually happening?

IE浏览器报错: Object doesn't support property or method 'blur'

Other?

1.6版本是正确的,是不是1.7升级这个功能的时候造成的: modal: 当 modal 打开关闭时自动切换焦点 (#2188) (7c0ced4), closes #2124

@wzhudev
Copy link
Member

wzhudev commented Nov 1, 2018

@kkalpha 请提供重现链接

@kkalpha
Copy link
Author

kkalpha commented Nov 1, 2018

@kkalpha 请提供重现链接
请参照更新: https://stackblitz.com/edit/ng-zorro-antd-start-y5nxnf
在IE中出错,chrome浏览器可以正常打开

@kkalpha
Copy link
Author

kkalpha commented Nov 1, 2018

从IE浏览器报错看: Object doesn't support property or method 'blur'
是不是IE的A标签不支持blur?

@wzhudev
Copy link
Member

wzhudev commented Nov 6, 2018

@kkalpha It works for me. I start a new project because stackblitz is too huge for IE11. 🤣

image

Actually IE11 supports <a> to blur.

image

@kkalpha
Copy link
Author

kkalpha commented Nov 8, 2018

@wendzhue
can you test to use the a link to open a 'modal':
when click the a tag: use the modalService to present a component.
const modal = this.modalService.create({
nzTitle: '',
nzContent: XXXComponent,
nzComponentParams: {
selectedEmployees: '1'
},
nzWidth: '700px',
nzClosable: false,
nzFooter: null
});

@wzhudev
Copy link
Member

wzhudev commented Nov 8, 2018

@kkalpha That's exactly what I did.

@kkalpha
Copy link
Author

kkalpha commented Nov 8, 2018

@wendzhue
The exact code for the "a link' part is as bellow, I had a i tag in between the a tag:

 <a  title="open modal"  (click)="openModal()">
  <i class="anticon anticon-user-add"></i>
</a> 

sorry for the misleading by just saying a link.
below is the screen shot:
modal

@kkalpha
Copy link
Author

kkalpha commented Nov 8, 2018

@wendzhue
the same code was working in 1.6

@ferqx
Copy link

ferqx commented Nov 19, 2018

我也是同样问题

@ferqx
Copy link

ferqx commented Nov 19, 2018

image

@ferqx
Copy link

ferqx commented Nov 19, 2018

用button按钮点击打开模态框不会出现这种错误,因为它们有focus和blur方法,i和a标签点击打开模态框会出现此类问题

hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue Dec 5, 2018
@hsuanxyz hsuanxyz added :trollface: IE and removed Need More Info labels Dec 5, 2018
@ferqx
Copy link

ferqx commented Jan 11, 2019

看日志7.0.0-rc.1版本已经修复,
当前项目ng-zorro-antd 版本:7.0.0-rc.3,
在IE11中并没有解决该问题,还是同样的报错,提交代码后请先测试通过再关闭。
image

@vthinkxie vthinkxie reopened this Feb 11, 2019
hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue Feb 13, 2019
Ricbet pushed a commit to Ricbet/ng-zorro-antd that referenced this issue Apr 9, 2020
* refactor(module:modal): refactor block scroll strategy

close NG-ZORRO#2612

* docs(module:modal): update docs

* test(module:modal): update cases for scrollbar

* refactor(module:modal): use OnPush change detection

close NG-ZORRO#2643, close NG-ZORRO#2656

* fix(module:modal, drawer): IE/Edge SVG doesn't support `blur`/`focus` method

close NG-ZORRO#2388

* fix(module:modal): fix animations

* refactor(module:modal): switch to Default change detection

* docs: add temporary use case for IE

* fix: scrollblock style
hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
* fix(module: drawer, modal): fix focus bug of IE
* fix(module:drawer): prevent repeatedly open drawer when tap focus element

close NG-ZORRO#2388
hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
* refactor(module:modal): refactor block scroll strategy

close NG-ZORRO#2612

* docs(module:modal): update docs

* test(module:modal): update cases for scrollbar

* refactor(module:modal): use OnPush change detection

close NG-ZORRO#2643, close NG-ZORRO#2656

* fix(module:modal, drawer): IE/Edge SVG doesn't support `blur`/`focus` method

close NG-ZORRO#2388

* fix(module:modal): fix animations

* refactor(module:modal): switch to Default change detection

* docs: add temporary use case for IE

* fix: scrollblock style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants