vueform / multiselect

Vue 3 multiselect component with single select, multiselect and tagging options (+Tailwind CSS support).
https://vueform.com
MIT License
808 stars 151 forks source link

focus() issue #398

Open WhatArmy2 opened 8 months ago

WhatArmy2 commented 8 months ago

How to programically focus() multiselect field? I am using vue3 and the solution given in the readme does not work. Thank you

aelnonym commented 8 months ago

@WhatArmy2 That way worked for me:

<script setup>
// ...
const input = ref();

const focusOnInput = () => {
  input.value.$refs.input.focus();
}
</script>

<template>
  <Multiselect
    ref="input"
    //...
  />

</template>

Btw, this kind of question is usually answered faster on their Discord channel