Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
prevent tappable ons-list-item on button click
-
I have taken ons-button in ons-list item I have called PushPage onclick of ons-list-item but I want to stop this event on click of on ons- button which is inside ons-list-item
-
@Gaurav So if I understand you correctly, you want ontap of the list item to pushPage, but the button which is in the list item to do something else, correct?
-
@Gaurav You need to stop event propagation for that:
<ons-list-item onclick="console.log('item')"> <ons-button onclick="event.stopPropagation(); console.log('button')"> button </ons-button> </ons-list-item>
-
thanks @Fran-Diox this worked for me