2

Currently the v-select change event will fires multiple times during user typing keywords. Is there any event will be only fired if user has select an option or press Enter to select an option. I don't want the change event be fired during user typing keywords.

1
  • input is total same as change Commented Sep 14, 2022 at 7:39

2 Answers 2

2
      <v-select
        v-model="valueGender"
        :items="items"
        :rules="[v => !!v || 'Item is required']"
        label="gender"
        @update:modelValue="setSameCode('gender', valueGender)"
      ></v-select>

It work for me

Sign up to request clarification or add additional context in comments.

Comments

1

V-Select#Events

Unfortunately, it looks like the change event only has a parameter that is the value of selected option. There is not event passed through for you to check what actually raised the change event. However, looking at the link above, there are other events you can use.

There is a keydown event listed here that you might be able to leverage. It takes in a keyboard event, you should be able to check what keyboard event was raise i.e. 'Enter'. There are also other events such as mousedown or mouseup.

1 Comment

yes, currently i choose to wrap the handler in a debounce method

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.