Replies: 2 comments 2 replies
-
I'm looking to do the same thing with list box. There is no ref api. Are we supposed to use forwardRef? |
Beta Was this translation helpful? Give feedback.
0 replies
-
For vue this works: <script setup>
const input = ref()
onMounted(() => {
if (input.value) {
input.value.el.focus()
}
})
</script>
<template>
<ComboboxInput ref="input" />
</template> |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there any way to autofocus the input field of a combobox, in VueJS?
I've got situation where I am programmatically showing the combobox and what it to then have focus.
I have tried setting
autofocus
on theComboboxInput
component like:But this has no affect.
I've also tried programmatically triggering focus using a reference on both the
ComboboxInput
and theCombobox
itself. e.g.:But that throws an error:
Is it actually possible to autofocus the input?
Beta Was this translation helpful? Give feedback.
All reactions