I am using Vue3 Setup Script and seeing as InputNumber wraps html input tag in a span I have used pin_1.value.$el.children[0].focus where pin_1 is my ref to InputNumber
Code: Select all
<template>
<InputNumber ref="pin_1" mode="decimal" />
</template>
<script setup lang="ts">
const pin_1 = ref()
const testFocus = () => {
const p1 = pin_1.value.$el.children[0]
p1.focus()
}
</script>