I have an input that uses the following events:
<b-nput class="input" id="link" v-model="link" placeholder="link" @focus="$event.target.select()" ></b-input>
How do I use this inside @focus="$event.target.select()"
Event:
The above method copies the value. I need to trigger the above selection focus event when the user clicks copy How can this be done correctly?
Provide a
reference
for your input:Then anywhere in the component script:
Add
saved
method as focus event handler:method:
edit:
Try adding
ref
to the input elementThen trigger focus programmatically within the method: