DEV Community

ThereAreManyLikeItButThisOneIsMine
ThereAreManyLikeItButThisOneIsMine

Posted on

Focus() not working on ref

In :</p> <p>const loginFormUsername = ref(null)</p> <p>I have an input:</p> <p><input ref="loginFormUsername" v-model="login.form.username" @input="watchUsernameInput" /></p> <p>When I attempt to use &quot;loginFormUsername.focus()&quot; I get the &quot;loginFormUsername.focus is not a function&quot;</p> <p>I&#39;ve tried:</p> <ul> <li>using loginFormUsername.focus() // the above error</li> <li>using loginFormUsername.value.focus() // nothing happens</li> <li>using vueuse/core focus functions // nothing happens</li> </ul> <p>Any help is appreciated.</p>

Top comments (0)