kint icon indicating copy to clipboard operation
kint copied to clipboard

Add "copy-to-clipboard" buttons

Open M-Mommsen opened this issue 6 years ago • 2 comments

It would be very helpful if there would be a copy-to-clipboard button (icon), especially for the "Show access path" textbox. Nowadays the document.execCommand('copy') function is widely supported, so this shouldn't be much of a problem and would help avoid many repetitive steps! Might even be as simple as using double click to copy, although in this case the user would need to know about that functionality first, of course.

M-Mommsen avatar Jan 07 '20 13:01 M-Mommsen

Alrighty, while this seems like a nice feature I have a few thoughts

copy-to-clipboard button (icon), especially for the "Show access path" textbox

I wouldn't want it to be a separate button, I'd much rather have it just copy as soon as it opens the ap.

But doing that might accidentally blow away the clipboard for people that aren't expecting it, which is a reason not to enable it on triple-click to select all in text displays either.

Theoretically it could be done with a flag on the renderer, but in either case I'd want a safe fallback.

Any other thoughts?

In the meantime Ctrl+C isn't that hard so it's low on my list for 4.0, but I'll keep it in mind.

jnvsor avatar Jan 10 '20 17:01 jnvsor

To protect the clipboard, this might be configurable. So the user may decide by setting a parameter if it is done via single, double, triple click or none at all (or icon ?) .

M-Mommsen avatar Jan 13 '20 08:01 M-Mommsen

I've decided not going to do this.

We already select the text when the AP is opened so Ctrl+C is both very little work and something people are probably doing by muscle memory, and copying it to the clipboard automatically is unexpected behavior that's likely to annoy more than it helps. (As well as not working on certain hardened browsers)

If you really want it you can add your own event handler to copy selection on .kint-access-path-trigger

jnvsor avatar Nov 10 '22 11:11 jnvsor