-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Open
Labels
P5The team acknowledges the request but does not plan to address it, it remains open for discussionThe team acknowledges the request but does not plan to address it, it remains open for discussionarea: coreIssues related to the framework runtimeIssues related to the framework runtimecore: event listenersfreq1: lowtype: bug/fix
Milestone
Description
Hello, I have an issue with event.stopImmediatePropagation()
I have a component as below
@Component({
selector: 'my-component',
template: '<button><ng-content></ng-content></button>'
})
export class MyComponent {
@HostListener('click', ['$event'])
onClick(event: Event){ console.log('stopImmediatePropagation'); event.stopImmediatePropagation(); }
}
And I use it like that
<my-component (click)="clicked()">Hello Angular 2</my-component>
As you see, I have bound 2 handlers onClick
& clicked
to same click
event
I expect that after onClick
handler execute, it should stop other ones.
But in fact, 2 these handlers always execute, event.stopImmediatePropagation()
doesn't work for me
Beside that, seemly, clicked
handler always execute first.
It mean that I have no chance to stop propagation by using HostListener
as I do above
Should event handlers have priority for execution ? or have any idea for this case ?
kemsky, connor4312, KirilNN, karptonite, meeeu and 35 more
Metadata
Metadata
Assignees
Labels
P5The team acknowledges the request but does not plan to address it, it remains open for discussionThe team acknowledges the request but does not plan to address it, it remains open for discussionarea: coreIssues related to the framework runtimeIssues related to the framework runtimecore: event listenersfreq1: lowtype: bug/fix