fix(button): only apply has-icon-only if icon has the slot for icon-only (#18343)

fixes #18329
This commit is contained in:
Brandy Carney
2019-05-22 11:28:06 -04:00
committed by GitHub
parent 788a56c5e9
commit d13983451a
2 changed files with 35 additions and 13 deletions

View File

@ -130,16 +130,8 @@ export class Button implements ComponentInterface {
}
}
private get hasLabel() {
return this.el.textContent !== null && this.el.textContent.trim() !== '';
}
private get hasIcon() {
return !!this.el.querySelector('ion-icon');
}
private get hasIconOnly() {
return this.hasIcon && !this.hasLabel;
return !!this.el.querySelector('ion-icon[slot="icon-only"]');
}
private get rippleType() {