Vuetify: [Bug Report] v-list-item ripple effect gets triggered when you click on v-list-item-action

Created on 25 Jul 2019  路  2Comments  路  Source: vuetifyjs/vuetify

Environment

Vuetify Version: 2.0.0
Last working version: 1.5.16
Vue Version: 2.6.10
Browsers: Mozilla Firefox, Google Chrome
OS: Windows, Mac OSX

Steps to reproduce

Click v-list-item-action on the demos linked below

1.5.16 - https://codepen.io/anon/pen/YmWWWb
2.0 - https://codepen.io/anon/pen/EqyyyR

Expected Behavior

Ripple effect should only be on v-list-item-action

https://codepen.io/anon/pen/YmWWWb

Actual Behavior

Ripple effect is triggered for both v-list-item and v-list-item-action

Reproduction Link

https://codepen.io/anon/pen/EqyyyR

Other comments

This is a regression from 1.5.x. Not sure if it is a feature or bug.

VRipple low bug regression

Most helpful comment

For anyone looking for a workaround, I fixed this issue by stopping the propagation of the mousedown and touchstart event inside the action:

<v-list-item :to="someRoute">
  <v-list-item-content>
      <v-list-item-title>Title</v-list-item-title>
  </v-list-item-content>

  <v-list-item-action>
    <v-btn icon @click.prevent="delete" @mousedown.stop @touchstart.native.stop>
      <v-icon>delete</v-icon>
    </v-btn>
  </v-list-item-action>
</v-list-item>

@click.prevent prevents the v-list-item from routing to someRoute when clicking on the button inside the action.

All 2 comments

Not really sure how we can efficiently fix this. v-list-item supports ripple now by default. If the same would have been the case for v1.5, it would have been experienced there as well.

https://codepen.io/johnjleider/pen/bXweXq

For anyone looking for a workaround, I fixed this issue by stopping the propagation of the mousedown and touchstart event inside the action:

<v-list-item :to="someRoute">
  <v-list-item-content>
      <v-list-item-title>Title</v-list-item-title>
  </v-list-item-content>

  <v-list-item-action>
    <v-btn icon @click.prevent="delete" @mousedown.stop @touchstart.native.stop>
      <v-icon>delete</v-icon>
    </v-btn>
  </v-list-item-action>
</v-list-item>

@click.prevent prevents the v-list-item from routing to someRoute when clicking on the button inside the action.

Was this page helpful?
0 / 5 - 0 ratings