Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
214 views
in Technique[技术] by (71.8m points)

javascript - Vuetify v-select does not support keyboard tab key

I have the form below for users. The issue here is when I am on first_name field and I press tab key on the keyboard it takes me to the last_name field. When I press tab key when I am on last_name field it skips the city field and goes directly to the phone_number field. I have to click on city field to select the city. Tab key doesn't take me to v-select. I am using vuetify version 2.3.10. I am not able to figure out a work around for this. Any idea how this can be resolved?

<template>
  <div>
    <v-form :model='user'>
      <v-text-field
       label='First Name'
       v-model='user.first_name'>
      </v-text-field>
      <v-text-field
       label='Last Name'
       v-model='user.last_name'>
      </v-text-field>
      <v-select 
       :items="cities"
       attach
       item-text='name'
       item-value='name'
       v-model="user.city"
       label="City">
      </v-select>
      <v-text-field
       label='Phone Number'
       v-model='user.phone_number'>
      </v-text-field>
    </v-form>
  </div>
</template>
question from:https://stackoverflow.com/questions/65943554/vuetify-v-select-does-not-support-keyboard-tab-key

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

v-select logically is text input, and the opened list is v-list-item, so if you want the list open on focus you have to add code like this to your v-select

<v-select 
  @focus="($event) => {$event.target.click()}"
<v-select 

Here is Codepen


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...