Ng-zorro-antd: IE10 modal 按钮不显示文字

Created on 14 Jun 2018  ·  2Comments  ·  Source: NG-ZORRO/ng-zorro-antd

Version

1.0.0

Environment

angular6 rxjs6 zorro1.0 ie10

Reproduction link

https://ng-zorro-antd-start-qyyqks.stackblitz.io/

Steps to reproduce

ie10 打开官网的modal 示例 即可看到

What is expected?

按钮有文字

What is actually happening?

按钮没文字

Other?

Bug 🤚 Blocked By @angulacdk

Most helpful comment

IE10下按钮不能显示通过变量绑定的内容,是因为浏览器对style属性的不同处理。
(1)谷歌浏览器chrome:元素上只有个style,而style没有值时,能正常显示
1

(2)IE10:元素上只有个style,而没有值时,会自动给style加上‘display:none’的值,导致不显示,所以,我们为了解决这个,只需要给按钮的内容样式进行覆盖操作,如下就可以使按钮内容显示出来了
2

All 2 comments

It is the bug of @angular/cdk, (cdkObserveContent) can not trigger in IE10:

<!-- nz-button.component.html -->
<span (cdkObserveContent)="checkContent()" #contentElement><ng-content></ng-content></span>

@angular/cdk do not support IE10, ref https://github.com/angular/material2/issues/7836#issuecomment-337336292

Export https://stackblitz.com/edit/cdkobservecontent on your environment to verify.

IE10下按钮不能显示通过变量绑定的内容,是因为浏览器对style属性的不同处理。
(1)谷歌浏览器chrome:元素上只有个style,而style没有值时,能正常显示
1

(2)IE10:元素上只有个style,而没有值时,会自动给style加上‘display:none’的值,导致不显示,所以,我们为了解决这个,只需要给按钮的内容样式进行覆盖操作,如下就可以使按钮内容显示出来了
2

Was this page helpful?
0 / 5 - 0 ratings