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(VListitem): disable mouse click in animating menu #12059

Merged
merged 2 commits into from Aug 18, 2020

Conversation

YipingRuan
Copy link
Contributor

fix #12021

Description

Motivation and Context

How Has This Been Tested?

Markup:

<template>
  <div id="app">
    <v-app id="inspire">
      <div class="text-center">
        <v-menu top>
          <template v-slot:activator="{ on, attrs }">
            <v-btn
              color="primary"
              dark
              v-bind="attrs"
              v-on="on"
            >
              Dropdown
            </v-btn>
          </template>

          <v-list>
            <v-list-item
              v-for="(item, index) in items"
              :key="index"
              disabled
              @click="onClick($event)"
            >
              <v-list-item-title>{{ item.title }}</v-list-item-title>
            </v-list-item>
          </v-list>
        </v-menu>
      </div>
    </v-app>
  </div>
</template>

<script>
  export default {
    data: () => ({
      items: [
        { title: 'Click Me Disabled' },
        { title: 'Click Me' },
        { title: 'Click Me' },
        { title: 'Click Me 2' },
      ],
    }),
    methods: {
      onClick (d) {
        alert('ups, clicked on a disabled item')
        console.log(d)
      },
    },
  }
</script>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any features but makes things better)

Checklist:

  • The PR title is no longer than 64 characters.
  • The PR is submitted to the correct branch (master for bug fixes and documentation updates, dev for new features and backwards compatible changes and next for non-backwards compatible changes).
  • My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

@YipingRuan YipingRuan added C: VList VList T: bug Functionality that does not work as intended/expected labels Aug 16, 2020
@KaelWD KaelWD changed the title fix(VListitem): disable mouse click fix(VListitem): disable mouse click in animating menu Aug 18, 2020
@KaelWD KaelWD merged commit 0b8ec25 into master Aug 18, 2020
@KaelWD KaelWD deleted the Fix/#12021_VListItem_disable_mouse_click branch August 18, 2020 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VList VList 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] Double click on dropdown menu with a disabled list-item triggers click event on that list-item
2 participants