I would like to copy text to the clipboard to help users transfer contact information from my website(s). Especially on phones, the select and copy operation can be cumbersome. Ideally I would create a button to copy text to the clipboard that I’ve preconfigured as a convenience similar to how “Open Mail” or “Go to External Link” operate where there is a single input defined by the developer and all the user has to do is click. So I created a button and of course among the list of convenient “On Click” features I didn’t find “Copy to Clipboard” in the list.
So I looked into embedding some code only to find that without a Button.On Click execute feature there was no way to link my Sparkle button click action to anything embedded and I’d have to code such a button from scratch. hmmm - I’d prefer to just stay in the visual development realm as much as possible to keep the management of my UI consistent and efficient.
In the end function outweighs form so I am hoping someone might have a clever workaround or a code snippet that actually works? The objective is simple - copy my predefined text to the clipboard. I would be satisfied if every time the page opened it just did that [copied my defined text to the clipboard] and I could use a Sparkle button for cosmetic theatre [on click=“Do Nothing”. User punches the button to copy Contact details when in reality the data was already there to begin with.