How can I prevent the click event from dispatching from a mousedown/mouseup event in the same element?
I already tried with both evt.preventDefault and evt.stopPropagation, but it doesn't seem to work. See example plunker here
<div>
<h2 (click)="onClickToBePrevented()" mouseEvents>
Click Here
</h2>
</div>
Directive mouseevents:
@(host: {
'(mousedown)': "preventClick($event)",
'(mouseup)': "preventClick($event)"
})
preventClick(evt){
evt.preventDefault();
evt.stopPropagation();
return false;
}