No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Prevent collapsible toggle when button in header

    Framework
    2
    4
    1588
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      steve last edited by steve

      I have a Collapsible List with a buttons in the header slot. If I click on the button, the collasible item expands. How can I prevent this from happening?

      <q-list separator class="q-mt-md" v-show="documents.length > 0">
         <q-collapsible v-for="(doc, index) in documents" :key="index" indent>
              <template slot="header">
                  <q-item>
                    <q-item-side left>
                       <q-btn icon="delete" @click="removeDocument(doc)" flat round />
                     </q-item-side>
                      <q-item-main :label="doc.title" />
                    </q-item>
                </template>
                <div>
                    {{doc.body}}
                </div>
        </q-collapsible>
      </q-list>
      
      1 Reply Last reply Reply Quote 0
      • S
        steve last edited by

        any ideas?

        1 Reply Last reply Reply Quote 0
        • C
          chbarr last edited by chbarr

          use the event modifiers of vue (https://vuejs.org/v2/guide/events.html#Event-Modifiers)

          you can add the stop modifier on q-btn. See in action: https://jsfiddle.net/f0cpycoL/1/

          S 1 Reply Last reply Reply Quote 2
          • S
            steve @chbarr last edited by

            @chbarr absolutely beautiful. I’ve used click.prevent, and knew there was something else available to stop to event trickle, which I now know is ‘stop’ 🙂

            1 Reply Last reply Reply Quote 0
            • First post
              Last post