Skip to content

Commit

Permalink
fix(module: action-sheet): fix click item without event (#99)
Browse files Browse the repository at this point in the history
* fix(module: action-sheet): fix click item without event
  • Loading branch information
nuonuoge authored and Guoyuanqiang committed Nov 7, 2018
1 parent 9663952 commit 8c840d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions components/action-sheet/action-sheet.component.html
Expand Up @@ -25,7 +25,7 @@ <h3 *ngIf="!isTemplateRef(title)" class="{{props.prefixCls}}-title">{{title}}</h
</div>
<div *ngIf="destructiveButtonIndex === i"
class="{{props.prefixCls}}-button-list-item {{props.prefixCls}}-destructive-button"
(click)="onPress(i)"
(click)="onPress(i, 0, $event)"
>
{{item}}
</div>
Expand All @@ -42,7 +42,7 @@ <h3 *ngIf="!isTemplateRef(title)" class="{{props.prefixCls}}-title">{{title}}</h
<div *ngSwitchCase="'SHARE'" class="{{props.prefixCls}}-share {{props.prefixCls}}-share-content">
<div *ngIf="!isArray(options, options[0])" class="{{props.prefixCls}}-share-list">
<ng-container *ngFor="let item of options; let i = index;">
<div class="{{props.prefixCls}}-share-list-item" (click)="onPress(i)">
<div class="{{props.prefixCls}}-share-list-item" (click)="onPress(i, 0, $event)">
<div class="{{props.prefixCls}}-share-list-item-icon">
<ng-template *ngIf="isTemplateRef(item.icon)" [ngTemplateOutlet]="item.icon"></ng-template>
<div *ngIf="!isTemplateRef(item.icon)" [innerHTML]="item.icon | safeHTML"></div>
Expand All @@ -52,9 +52,9 @@ <h3 *ngIf="!isTemplateRef(title)" class="{{props.prefixCls}}-title">{{title}}</h
</ng-container>
</div>
<ng-container *ngIf="isArray(options, options[0])">
<div *ngFor="let items of options;" class="{{props.prefixCls}}-share-list">
<div *ngFor="let items of options; let rowIndex = index" class="{{props.prefixCls}}-share-list">
<ng-container *ngFor="let item of items; let i = index;">
<div class="{{props.prefixCls}}-share-list-item" (click)="onPress(i)">
<div class="{{props.prefixCls}}-share-list-item" (click)="onPress(i, rowIndex, $event)">
<div class="{{props.prefixCls}}-share-list-item-icon">
<ng-template *ngIf="isTemplateRef(item.icon)" [ngTemplateOutlet]="item.icon"></ng-template>
<div *ngIf="!isTemplateRef(item.icon)" [innerHTML]="item.icon | safeHTML"></div>
Expand Down
2 changes: 2 additions & 0 deletions components/action-sheet/action-sheet.component.spec.ts
Expand Up @@ -83,6 +83,8 @@ describe('ActionSheetComponent', () => {
3,
'shareActionSheetMulpitleLine is work'
);
actionSheetEle.querySelector('.am-action-sheet-share-list-item').click();
fixture.detectChanges();
});

it('should close work', () => {
Expand Down

0 comments on commit 8c840d5

Please sign in to comment.