Skip to content

Commit

Permalink
fix(module: action-sheet): fix click item will response background cl…
Browse files Browse the repository at this point in the history
…ick event (NG-ZORRO#98)
  • Loading branch information
Guoyuanqiang committed Nov 6, 2018
1 parent 8bcfda5 commit b24bcbc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/action-sheet/action-sheet.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="{{props.prefixCls}}-mask {{maskTransitionName}}"></div>
<div class="{{props.prefixCls}}-wrap {{transitionName}}" (click)="onPress(-1)">
<div class="{{props.prefixCls}}-wrap {{transitionName}}" (click)="onPress(-1, 0, $event)">
<div role="document"
class="{{props.prefixCls}}"
[ngClass]="showShare(flag)">
Expand All @@ -19,7 +19,7 @@ <h3 *ngIf="!isTemplateRef(title)" class="{{props.prefixCls}}-title">{{title}}</h
<TouchFeedBack class="{{props.prefixCls}}-button-list-item" [activeClassName]="activeClassName" >
<div *ngIf="destructiveButtonIndex !== i && cancelButtonIndex !== i"
class="{{props.prefixCls}}-button-list-item"
(click)="onPress(i)"
(click)="onPress(i, 0, $event)"
>
{{item}}
</div>
Expand All @@ -31,7 +31,7 @@ <h3 *ngIf="!isTemplateRef(title)" class="{{props.prefixCls}}-title">{{title}}</h
</div>
<div *ngIf="cancelButtonIndex === i"
class="{{props.prefixCls}}-button-list-item {{props.prefixCls}}-cancel-button"
(click)="onPress(i)"
(click)="onPress(i, 0, $event)"
>
{{item}}
<span class="{{props.prefixCls}}-cancel-button-mask"></span>
Expand Down
3 changes: 2 additions & 1 deletion components/action-sheet/action-sheet.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export class ActionSheet {
options.maskTransitionName = `${maskTransitionName}-enter ${maskTransitionName}-enter-active`;
const props = ActionSheet._initConfig(config, options);
Object.assign(props, { onPress: cb }, { flag: flag });
function cb(index: any, rowIndex = 0) {
function cb(index: any, rowIndex = 0, event) {
event.stopPropagation();
const res = callback(index, rowIndex);
if (res && res.then) {
res.then(() => {
Expand Down

0 comments on commit b24bcbc

Please sign in to comment.