You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ant-btn-icon-only works wrong with dynamic importing icons #7631
In ng-zorro 14, there is a check that the icon child of button is a <span> element, that has an <svg> child. I think this might be a little extreme, as it excludes any custom components.
Perhaps a markup like this should be valid, meaning nz-button only checks that <nz-icon> or <any-tag><svg></svg></any-tag> exists. Checking for the existance of <svg> is good but might have issues with delayed rendering (dynamic) of the svg component.
Activity
oestrogen commentedon Sep 8, 2022
I have the same problem and noticed it mostly happens on the first "real" page load. I can reproduce this in the NG-Zorro documentation:
simplejason commentedon Sep 9, 2022
We very much expect you to submit a PR to fix this issue :) cc @hullis If you have time, please also check this issue :)
Nosfistis commentedon Sep 28, 2022
Hi, we are using custom icons (FontAwesome) in a nested component. In ng-zorro 13, it worked fine using the markup below:
In ng-zorro 14, there is a check that the icon child of button is a
<span>element, that has an<svg>child. I think this might be a little extreme, as it excludes any custom components.Perhaps a markup like this should be valid, meaning nz-button only checks that
<nz-icon>or<any-tag><svg></svg></any-tag>exists. Checking for the existance of<svg>is good but might have issues with delayed rendering (dynamic) of the svg component.It could also support deeper structures such as
The check might also be done using
ViewChild, for a more angular way.I am willing to submit a PR.
fix(module:button): fix add class ant-btn-icon-only(#7631) (#7678)