Subscribe on changes!

textarea v-model with ref not working together when setting focus

avatar
Mar 8th 2022

Version

3.2.31

Reproduction link

sfc.vuejs.org/

Steps to reproduce

What is expected?

expected the set focus on the input field

What is actually happening?

but the textarea somehow become non-editable and showing this text "[object HTMLTextAreaElement]"

avatar
Mar 8th 2022

You use the same ref object for the value and DOM element. Simply use a second ref object to grab the DOM element. Updated example