I would like to reproduce this behaviour of github when you clone a url : select all the content when clicked.
in JavaScript it's as simple as that :
<input @focus="$event.target.select()">
in ipyvuetify I can build the component :
import ipyvuetify as v
import pyperclip
class CopyLink(v.TextField):
def __init__(self):
super().__init__(
class_ = "ma-5",
v_model = 'je suis un link',
outlined = True,
label = 'link',
readonly = True,
append_icon = 'mdi-clipboard-outline'
)
self.on_event('click', self.copy_link)
def copy_link(self, widget, event, data):
# copy the link to clipboard using
pyperclip.copy(self.v_model)
# select all the content in case pyperclip fail
return
I can copy the value to the clipboard using pyperclip but in case the function fail I would like to be able to select all the textfield content. Is it possible ?
