0👍
In case someone went to the same issue
here’s my solution
<script setup lang="ts">
import { ref, watch } from 'vue'
const modal = ref<boolean>(false)
const btn = ref<HTMLButtonElement>()
watch(modal, (newVal: boolean) => {
if (newVal==true) {
setTimeout(() => {
btn.value!.focus()
}, 100)
}
})
</script>
- [Vuejs]-VueJS2: Drop down menus and navigating away: If user returns to menu, how to pre-select the option he had chosen?
- [Vuejs]-Vue3 graphql composition api dynamic router not working
Source:stackexchange.com