Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Disable hover effect on v-checkbox in Vuetify 2

When hovering over a v-checkbox in Vuetify 2, a darkened circle appears behind the checkbox. I would like to make this not appear. Currently, my v-checkbox is wrapped in a v-tab and a v-tooltip. I doubt that matters, but it is possible.

<v-tab v-for="tab in myTabList" :key="tab">
  <span>{{$t(tab)}}</span>
  <v-tooltip bottom>
    <template #activator="{ on }">
      <span v-on="on">
        <v-checkbox @click.stop/>
      </span>
    </template>
    <span>Tooltip text</span>
  </v-tooltip>
</v-tab>

I tried wrapping it in a v-hover and using the disabled prop, but that didn’t work.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

That’s the ripple effect, you can turn it off using the :ripple prop:

<v-checkbox
  :ripple="false"
  ...
/>

Here it is in a snippet:

new Vue({
  el: '#app',
  vuetify: new Vuetify(),
  data() {
    return {
      myTabList: [1, 2, 3]
    }
  }
})
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@mdi/font@6.x/css/materialdesignicons.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.min.css" rel="stylesheet">

<div id="app">
  <v-app>
    <v-main>
      <v-container>
        <v-tab v-for="tab in myTabList" :key="tab">
          <span>{{tab}}</span>
          <v-tooltip bottom>
            <template #activator="{ on }">
              <span v-on="on">
                <v-checkbox @click.stop :ripple="false"/>
              </span>
            </template>
            <span>Tooltip text</span>
          </v-tooltip>
        </v-tab>
      </v-container>
    </v-main>
  </v-app>
</div>

<script src="https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js"></script>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading