vue-clipboard2
vue-clipboard2 copied to clipboard
Focus must stay on the link/button
Steps to reproduce
- Run the sample app
- Focus on the text field
- Now tab to the "Copy Text" button
Expected result
Keyboard focus stays on "Copy Text"
Actual result
Focus moves to the next field.
Version
Happens on vue-clipboard2 git master 8a542c558c6857212d06f6fc1929384a5b5104cc and also on version 0.3.1
Further notes
If you remove the "v-clipboard:copy" attribute and retest you can see that the focus stays.
The problem also happens when using $copyText.
I have the same issue, a workaround is to reset the focus on the text field after copy.
this.$copyText('my content').then(() => {
this.$refs.mytextFieldInput.focus();
});