0

I'm using vue-multiselect(V2.1.6) component for my project with nuxt 2 and Vue 2.6. Here created the component with asynchronous search which I need to search a word by typing. Furthermore, I need to restrict the search word's character length to 25 in other words the user cannot type more than 25 characters for a search. There is another implementation there which is if the word is not having the choices I can save it as a new word too. It's working fine But I need to give a character length for searching.

Here is my component

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<multiselect
      :id="questionCode"
      ref="multiselect"
      v-click-outside="hide"
      :value="initialValue"
      :question-code="questionCode"
      label="text"
      track-by="answerCode"
      open-direction="bottom"
      :options="choices"
      :searchable="true"
      :loading="isLoading"
      :internal-search="false"
      :clear-on-select="false"
      :close-on-select="true"
      :options-limit="300"
      :limit="3"
      :limit-text="limitText"
      :max-height="600"
      :show-no-results="false"
      :hide-selected="true"
      :disabled="!isEnabled"
      :show-labels="false"
      :max-length="2"
      :class="
        isErrorVisible ? 'question-error--outline' : 'question-regular--outline'
      "
      @search-change="asyncFind"
      @select="$emit('update:initialValue', $event)"
      @open="asyncFind('')"
    ></multiselect>

Select component

Hashan94
  • 117
  • 1
  • 7
  • 1
    there's no prop for this and you can't bind any variable to the search box. Trying to manually set the inner `` value with document querySelector didn't work when I tried, so I'm not sure this is possible. You might want to reach out directly to the maintainers by asking on the [vue-multiselect github](https://github.com/shentao/vue-multiselect/issues) – yoduh Mar 26 '23 at 16:57
  • @yoduh yeah I tried with catching the id in input but It may be caused when the component renders dynamically. Btw its fine now. Thanks!!! – Hashan94 Mar 27 '23 at 10:06
  • If you found a solution please post it for other future readers – yoduh Mar 27 '23 at 15:19

0 Answers0