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(VSelect): add call blur method in onBlur #15906

Conversation

yanskun
Copy link

@yanskun yanskun commented Oct 16, 2022

Description

fixes #15839

VSelect's onBlur fires when clicking on a Disabled Item, but the VSelect never closes, so fixed it to close.

Motivation and Context

Users will be confused if one of the following measures is not taken

  1. Incorporate this fix to close the VSelect when clicking a disabled item
  2. Prevent onBlur from firing when a disabled item is clicked

In the case of 2, another response is required, so please let me know if that is acceptable.
because I want to fix

How Has This Been Tested?

2022-10-16.22.28.34.mov

Markup:

<template>
  <v-container>
    <span>Blur count: {{ blurCount }}</span>
    <v-select
      :items="items"
      multiple
      @blur="onBlur"
    ></v-select>
  </v-container>
</template>

<script>
  export default {
    data: () => ({
      blurCount: 0,
      items: [
        { text: 'Text 1', value: 1, disabled: false },
        { text: 'Text 2', value: 2, disabled: true },
      ],
    }),
    methods: {
      onBlur () {
        this.blurCount++
      },
    },
  }
</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)

Copy link
Member

@KaelWD KaelWD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The menu should not close if a disabled item is clicked

@yanskun
Copy link
Author

yanskun commented Jan 9, 2023

@KaelWD

The menu should not close if a disabled item is clicked

really?
In my local, it closed successfully.

hmm,

2023-01-09.20.12.36.mov

By "disabled item" do you mean items with disabled: true?

@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VSelect VSelect labels Jan 10, 2023
@johnleider johnleider added this to the v2.6.x milestone Jan 10, 2023
@yanskun yanskun requested a review from KaelWD January 11, 2023 05:52
@KaelWD KaelWD changed the base branch from master to v2-stable February 5, 2023 09:55
@KaelWD KaelWD modified the milestones: v2.6.x, v2.7.x Jul 5, 2023
@KaelWD
Copy link
Member

KaelWD commented Feb 12, 2024

In my local, it closed successfully

Yeah that's what I meant, it shouldn't do that

@KaelWD KaelWD closed this Feb 12, 2024
@KaelWD KaelWD removed this from the v2.7.x milestone Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VSelect VSelect 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][2.6.10] VSelect triggers blur when clicking on disabled item
3 participants