8000 Native click event of inner element busted by outer ngClick element · Issue #12392 · angular/angular.js · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Native click event of inner element busted by outer ngClick element #12392
Closed
@jackysee

Description

@jackysee

When there is a nested structure, e.g.

<div ng-click="action()">
    <button my-click>mybutton</my-button>
    <p>lipsum....</p>
</div>

where my-click is a directive that have native click binding:

link: function(scope, el, attrs){
    el.on('click', function(ev){ 
       //...some other action
       // ev.stopPropagation() won't work as ngTouch use event capture
    });
}

The native click event won't call when click on the button. The click event is busted. The outer div has raised touchstart and touchend and thus busted all internal click event from nested element. You cannot stop the event propagation from button to div as it is capturing mode.

demo at http://plnkr.co/edit/NQ09S0EGqoiPs6QTIhLY?p=preview

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0