Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop ng-click propagation on list item buttons #550

Closed
xuyuanme opened this issue Feb 7, 2014 · 4 comments
Closed

Stop ng-click propagation on list item buttons #550

xuyuanme opened this issue Feb 7, 2014 · 4 comments
Assignees
Milestone

Comments

@xuyuanme
Copy link

xuyuanme commented Feb 7, 2014

Currently the item option buttons and delete button on the list item will propagate the click event. So if another ng-click function is defined on the list item itself, it will be triggered by clicking the build-in item option or delete button, which is sometimes unwanted.

Adding $event.stopPropagation() in the ionicList.js template would help, or at least there should be an option to let user choose stop the ng-click propagation:

// js/ext/angular/src/directive/ionicList.js
ng-click="deleteClick(); $event.stopPropagation();"
ng-click="b.onTap(item, b); $event.stopPropagation();"
@adamdbradley adamdbradley added this to the 0.9.25 milestone Feb 7, 2014
@adamdbradley adamdbradley self-assigned this Feb 7, 2014
@ajoslin ajoslin closed this as completed Feb 7, 2014
@ajoslin
Copy link
Contributor

ajoslin commented Feb 7, 2014

Wrong issue in my commit! Meant #528. That's what happens when you have too many issues open :-)

@ajoslin ajoslin reopened this Feb 7, 2014
@adamdbradley
Copy link
Contributor

Yeah good call, thanks for letting us know.

@ajoslin I created a stopEvent directive that can be reused for various directives, like:

<button ng-click="myClick()" stop-event="click">Click Me</button>

@ajoslin
Copy link
Contributor

ajoslin commented Feb 13, 2014

Nice! I like it.
On Feb 13, 2014 12:08 AM, "Adam Bradley" notifications@github.com wrote:

Yeah good call, thanks for letting us know.

@ajoslin https://github.com/ajoslin I created a stopEvent directive
that can be reused for various directives, like:

Click Me

Reply to this email directly or view it on GitHubhttps://github.com//issues/550#issuecomment-34948995
.

@techhysahil
Copy link

ion-stop-event solve the problem on laptop browser but the issue still persist on android app.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants