@ghenry22 (Gaven Henry) posted a new topic, subject "Button inside a Button (ionic2)". It read:

   Is there any way to achieve an ion-item with functionality similar to the list items in spotify? Where there is a default action for the list item but also a “more” button on the list item that performs a different action.
    
    That is a touch anywhere on the ion item EXCEPT the little more icon indicated by the red arrow performs the default action (go to detail view for example). But a click on the little more icon performs a different action (ie open an actionsheet/pop up or go to a different view than the main click).
    
    button-in-button.jpg745×110 9.23 KB
    
    I can't figure out how to do it as following the ionic2 examples my ion-item is already a button so clicking anywhere on it triggers the default action.
    
    I am using ionic2 Beta7
    
    Appreciate any pointers.

So @mhartington (Mike Hartington) replied

    Could you share what you have tried so far right now

After which, @ghenry22 (Gaven Henry) added

    @mhartington \- I have attached a link to a plunker showing where I am at and what I have tried.
    
    tap on the item is fine, but tap on the icon button on the right side just passed through to the main button.
    
    Really appreciate any hints on this one.
    
    plnkr.co
    
    ### Plunker
    
    Created on Plnkr: Helping developers build the web.

After which, @ghenry22 (Gaven Henry) added

    I have updated my plunker above with a solution for anyone who is looking for the same thing. While this works and achieves what I wanted I'm not sure that it's the most elegant or best solution so would still appreciate feedback from those more savvy than myself!

@mhartington (Mike Hartington) replied

    This would be a much better solution than the one you had provided.
    
    plnkr.co
    
    ### Plunker
    
    Created on Plnkr: Helping developers build the web.

Then @ghenry22 (Gaven Henry) said

    @mhartington \- First thanks for the help! That is pretty much where I started. The problem with that is that the main ion-item is not clickable.
    
    if I change ion-item to button ion-item then the whole ion-item becomes clickable for the default action but there is no way to put another button within that ion-item with a seperate action.
    
    if I don't wrap the ion-item in a button then there is no touch highlight indication and touch is intermittently unresponsive on devices. The ionic2 docs indicate that using a button ion-item ensures that the item is clickable and responds correctly.
    
    Your solution certainly seems like the right way to go, it just doesn't work 
    
    Maybe there could be an enhancement where if you add a button item-right inside a button ion-item it gives that button a higher z-index so that it is clickable seperately to the main item? That would make your solution work as I would expect it to.
    
    I can log an issue on github for this if you think that's the best way to go.
    
    edit: I have updated my plunker with a simplified solution as well, the closest I can get to yours while retaining functionality.

To which @comfortme (Comfortme) replied

    I feel your pain   
    i also wanted to achive the same functionality as ios recent calls page but failed.  
    it is strange that ionic doesn't take care of this automatically since it is a widely used interface.  
    thank you for your workaround.

Then @sZerner (Stephan Zerner) said

    Try this in your template of the inner button:
    [code] 
        (click)="myClickHandler(myParameter, $event)"
        
    [/code]
    
    and in your corresponding .ts
    [code] 
        myClickHandler(myParameter: foo, event: Event) {
             event.stopPropagation();
             ...
        }
        
    [/code]
    
    so that the`(click)` handler of your outer button element is not triggered when clicking the inner button.

After which, @comfortme (Comfortme) added

    wow that's brilliant. works perceftly. thank you.

Then @pjhartin (Phillip Hartin) said

    Excellent, thanks @sZerner!

To which @adhiana46 (Adhiana46) replied

    thanks for your solution


{'source': 'discourse', 'url': 'https://forum.ionicframework.com/t/button-inside-a-button-ionic2/53688', 'title': 'Button inside a Button (ionic2)', 'views': 4919, 'has_accepted_answer': False, 'word_count': 611, 'like_count': 7, 'reply_count': 8, 'participant_count': 6, 'posts': 11, 'tags': '', 'author': '@ghenry22 (Gaven Henry)', 'participants': '@ghenry22 (Gaven Henry), @mhartington (Mike Hartington), @comfortme (Comfortme), @sZerner (Stephan Zerner), @pjhartin (Phillip Hartin), @adhiana46 (Adhiana46)', 'image_url': ['https://global.discourse-cdn.com/ionicframework/original/3X/7/3/73a906ec15c0c50f4ca92b80022642260e23a1a2.jpg'], 'created_at': '2016-06-02T04:47:37.345Z', 'last_posted_at': '2018-08-31T14:28:00.886Z'}