Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(VChip): add stopPropagation on close event. #17947

Conversation

prashantsinghb
Copy link
Contributor

fixes #17804

Description

Currently click on close button fires both click and click:close event.
Added stopPropagation on close event so that only click:close event is fired.

Markup:

<template>
  <div class="text-center" v-if="chips>0">
    <v-chip
      class="ma-2"
      @click="click++"
      v-for="i in 3"
      :key="i"
      closable
      @click:close="chips--"
    >
      Closable {{i}}
    </v-chip>
  </div>
  click content: {{click}}
  <v-btn v-if="chips==0" close color="primary" dark @click="chips=10;click=0">
    Reset Chip
  </v-btn>
</template>

<script>
  export default {
    data() {
      return {
        chips: 3,
        click: 0,
      }
    },
  }
</script>

@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VChip VChip labels Aug 8, 2023
@johnleider johnleider added this to the v3.3.x milestone Aug 8, 2023
@johnleider johnleider merged commit 54a340e into vuetifyjs:master Aug 8, 2023
3 of 5 checks passed
@prashantsinghb prashantsinghb deleted the fix/17804-vchip-click-event-conflict branch August 9, 2023 05:09
prashantsinghb added a commit to prashantsinghb/vuetify that referenced this pull request Aug 9, 2023
fixes vuetifyjs#17804

Co-authored-by: John Leider <john@vuetifyjs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VChip VChip T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report][3.3.8] VChip click event conflict
2 participants