Expansion item: How to handle expand click as well as custom button



  • Hi,

    I have a button on the right of an expansion-item.
    Currently, when I click on the button, it also triggers the expand due to event propagation.
    How can I prevent the expansion item to expand when clicking the qBtn ?
    Thank you!

                <q-expansion-item switch-toggle-side>
                  <template #header>
                    <q-item-section>
                      Expand This
                    </q-item-section>
                    <q-item-section side>
                      <q-btn flat color="primary" icon="more_vert">
                        <q-menu>
                         This is a QMenu
                        </q-menu>
                      </q-btn>
                    </q-item-section>
                  </template>
               </q-expansion-item
    

    fcc7e02a-cb48-4aaa-961f-910981b15651-image.png



  • @yananas Try:

    <q-btn @click.stop flat color="primary" icon="more_vert">
      <q-menu>
        This is a QMenu
      </q-menu>
    </q-btn>
    


  • Worked, thank you!


Log in to reply