3 ms·
re: browser support (which is where this problem should be fixed) A trivial compromise that would be even easier to use than the current javascript/selection s
by pdkl95 11y ago
re: browser support (which is where this problem should be fixed)
A trivial compromise that would be even easier to use than the current javascript/selection stuff would be a "copy to clipboard" variant of the <button> tag. Something like this should satisfy the use-cases where this clipboard nonsense is occasionally useful:
<form>
<input name="copy_souce" type="text" value="xyzzy" />
<button type="clipboard" value="copy_source"
name="Copy To Clipboard" />
</form>
This wouldn't require any Javascript, and leaves the clipboard entirely under the control of the user where it belongs.
This could even be extended to allow copying of the various types of input tags, and if you wanted to get fancy, the button could reference an #id and copy that element's textContent (or innerHTML).
- stephenr 11y agoOr people could .. You know... Use their platforms existing copy functionality. I know it's only existed on desktop computers since the Apple Lisa, and 30 years isn't very long for people to grasp the concept of copy and paste without a button to do it, but I have faith in people.
- henvic 11y agoThis button couldn't be customized, otherwise it's useless as someone could easily get away with hiding it / showing only a small portion of it where someone could click without even noticing / etc. Maybe a small modal-like confirmation that can be placed anywhere on the viewport and is actually on top of everything natively (like Safari's copy/paste on iOS). Of course, this modal-like confirmation must not be customized or its effect is useless. Or let's just forget entirely and remove the functionality from the browsers.