Skip to content

Commit

Permalink
fix(SwalDirective): stop propagation of click event to parent handlers (
Browse files Browse the repository at this point in the history
#28)

This fixes this case:

```
<tr [routerLink]='foo'>
  <td>
    <a [swal]="swalOptions">Bar</a>
  <td>
</tr>
```

Where clicking on the `a` link triggered the swal but also triggered the `tr` *routerLink*.
  • Loading branch information
fklingler authored and Morgan Touverey-Quilling committed Oct 11, 2017
1 parent 00ee2d5 commit 5445f3b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/swal.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class SwalDirective {
public onHostClicked(event: MouseEvent): void {
event.preventDefault();
event.stopImmediatePropagation();
event.stopPropagation();

const options = { ...this.defaultSwalOptions, ...this.modalOptions };

Expand Down

0 comments on commit 5445f3b

Please sign in to comment.