Skip to content

Commit a731528

Browse files
committed
fix(action-sheet): add icon-left to the button if an icon exists
1 parent e26c425 commit a731528

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/action-sheet/action-sheet-component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import { ViewController } from '../../navigation/view-controller';
1919
'<div class="action-sheet-group">' +
2020
'<div class="action-sheet-title" id="{{hdrId}}" *ngIf="d.title">{{d.title}}</div>' +
2121
'<div class="action-sheet-sub-title" id="{{descId}}" *ngIf="d.subTitle">{{d.subTitle}}</div>' +
22-
'<button ion-button="action-sheet-button" (click)="click(b)" *ngFor="let b of d.buttons" class="disable-hover" [ngClass]="b.cssClass">' +
22+
'<button ion-button="action-sheet-button" (click)="click(b)" *ngFor="let b of d.buttons" class="disable-hover" [attr.icon-left]="b.icon ? \'\' : null" [ngClass]="b.cssClass">' +
2323
'<ion-icon [name]="b.icon" *ngIf="b.icon" class="action-sheet-icon"></ion-icon>' +
2424
'{{b.text}}' +
2525
'</button>' +
2626
'</div>' +
2727
'<div class="action-sheet-group" *ngIf="d.cancelButton">' +
28-
'<button ion-button="action-sheet-button" (click)="click(d.cancelButton)" class="action-sheet-cancel disable-hover" [ngClass]="d.cancelButton.cssClass">' +
28+
'<button ion-button="action-sheet-button" (click)="click(d.cancelButton)" class="action-sheet-cancel disable-hover" [attr.icon-left]="d.cancelButton.icon ? \'\' : null" [ngClass]="d.cancelButton.cssClass">' +
2929
'<ion-icon [name]="d.cancelButton.icon" *ngIf="d.cancelButton.icon" class="action-sheet-icon"></ion-icon>' +
3030
'{{d.cancelButton.text}}' +
3131
'</button>' +

src/components/action-sheet/test/basic/app-module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ export class E2EPage {
1818
{
1919
text: 'Delete',
2020
role: 'destructive',
21-
icon: !this.platform.is('ios') ? 'trash' : null,
21+
icon: 'trash',
2222
handler: () => {
2323
console.log('Delete clicked');
2424
this.result = 'Deleted';
2525
}
2626
},
2727
{
2828
text: 'Share',
29-
icon: !this.platform.is('ios') ? 'share' : null,
29+
icon: 'share',
3030
handler: () => {
3131
console.log('Share clicked');
3232
this.result = 'Shared';
3333
}
3434
},
3535
{
3636
text: 'Play',
37-
icon: !this.platform.is('ios') ? 'arrow-dropright-circle' : null,
37+
icon: 'arrow-dropright-circle',
3838
handler: () => {
3939
let modal = this.modalCtrl.create(ModalPage);
4040
modal.present();

0 commit comments

Comments
 (0)