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/#11989 autocomplete focus #12397

Merged
merged 6 commits into from Nov 10, 2020
Merged

Conversation

YipingRuan
Copy link
Contributor

fix #11989
fix #12031 (The wrong fix)

Description

Copied idea from VTextField

Motivation and Context

How Has This Been Tested?

Markup:

<template>
  <div id="app">
    <v-app>
      <div style="width: 200px; margin: auto;">
        <v-autocomplete
          ref="autocomplete"
          v-model="model"
          :items="items"
        ></v-autocomplete>
        <v-btn @click.stop="focusAutocomplete">focus</v-btn>
        <v-text-field
          ref="textfield"
          v-model="model"
        ></v-text-field>
        <v-btn @click.stop="focusTextField">focus</v-btn>
        <v-select :items="items"></v-select>
      </div>
    </v-app></div>

</template>

<script>
  export default {
    data: () => ({
      model: null,
      items: [
        'Autocompletes', 'Comboboxes', 'Forms', 'Inputs', 'Overflow Buttons', 'Selects', 'Selection Controls', 'Sliders', 'Textareas', 'Text Fields',
      ],
    }),
    computed: {
      dateRangeText () {
        return this.dates.join(' ~ ')
      },
    },
    methods: {
      focusAutocomplete () {
        this.$refs.autocomplete.focus()
      },
      focusTextField () {
        this.$refs.textfield.focus()
      },
    },
  }
</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)

@johnleider johnleider added C: VAutocomplete VAutocomplete T: bug Functionality that does not work as intended/expected labels Oct 21, 2020
@johnleider johnleider added this to the v2.3.x milestone Oct 21, 2020
@johnleider
Copy link
Member

Requesting Final comments from @vuetifyjs/contributors @vuetifyjs/core-team

@MajesticPotatoe MajesticPotatoe merged commit 5100e6e into master Nov 10, 2020
@MajesticPotatoe MajesticPotatoe deleted the Fix/#11989_Autocomplete_focus branch November 10, 2020 21:14
MajesticPotatoe pushed a commit that referenced this pull request Nov 11, 2020
* fix(vautocomplete): set isFocused to false on blur

fix #11989

* Add test

* Remove override onBlur at VSelect

* Fix VSelect

Co-authored-by: John Leider <john.j.leider@gmail.com>
KaelWD added a commit that referenced this pull request Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VAutocomplete VAutocomplete 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] VAutocomplete focus is working half the time
3 participants