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

    How to prevent the focus of a button in a list item

    Framework
    3
    5
    564
    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.
    • C
      Clyde last edited by

      I have q-list component and q-item elements in it. Each item contains a section (q-item-section side) with action buttons. How can I prevent the first action button get focus when the mouse cursor hovers over a list element?

      alt text

      <q-list>
        <q-item tag="label" v-for="(item, index) in this.sensors" v-bind:key="index">
          <q-item-section>
            <q-item-label>{{item.name}}</q-item-label>
            <q-item-label caption>{{item.sens}}</q-item-label>
            <q-item-label caption>{{item.descr}}</q-item-label>
          </q-item-section>
          <q-item-section side>
            <div class="row">
              <q-btn flat round color="grey-8" icon="mdi-pencil" />
              <q-btn flat round color="grey-8" icon="mdi-delete" />
            </div>
          </q-item-section>
        </q-item>
      </q-list>
      
      metalsadman 1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman @Clyde last edited by

        @Clyde tabindex="-1"

        C 1 Reply Last reply Reply Quote 1
        • C
          Clyde @metalsadman last edited by

          @metalsadman said in How to prevent the focus of a button in a list item:

          tabindex="-1"

          Thank you for answer. But I’m not sure for which element I should set this property. I tried it from action buttons to the whole list, but without success. Still when the mouse cursor is over list item, the item has focus, but the first action button as well. Will it have something to do with the hover or mouseOver feature?

          1 Reply Last reply Reply Quote 0
          • T
            turigeza last edited by

            @Clyde Remove the tag="label" and add clickable instead and it should work fine.
            https://codepen.io/turigeza/pen/xxVoOxW

            C 1 Reply Last reply Reply Quote 2
            • C
              Clyde @turigeza last edited by

              @turigeza Thank you! It works perfectly. This wouldn’t really occur to me.

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