News for hackers. Stuff that matters.
Re:Clipboard.js: Modern Copy to Clipboard by david-given on Wednesday September 30, 2015 @05:47AM (#10302779)
Text field autoselection and programs being 'helpful' by copying things to the clipboards is one of the banes of my life. I wish there was a way to just disable all this, globally. If I want something selected, I'll select it myself, thanks.

My problem with text field autoselection is that it's wrecking my muscle memory of how to interact with text fields. My reflexes know that a single click places the cursor, a double click selects a word, and a triple click selects a line... except when the text field has autoselect turned on, which I can only find out after I've committed to the action. And they all behave slightly differently.

Example interaction:

- click on text field to place cursor.

- text field autoselects. I swear.

- click again to place cursor.

- hasn't been long enough since the last click, which means it's interpreted as a double click.

- text field selects word. I swear.

At this point I'll either force myself to wait for a second or so, to make the interaction time out, and then click again, or else I'll be too impatient and the madness continues as my third click is interpreted as a triple-click.

Seriously, wish there was a way to make this all stop. If I want my text fields selected, I'll do it myself, thanks.

Re:Clipboard.js: Modern Copy to Clipboard by leephillips on Wednesday September 30, 2015 @08:29AM (#10303386)
Thanks for giving voice to my pain. Phone number input boxes like to torture me - the ones conveniently divided into three boxes for the three parts of the number. I like to use the keyboard. I tab into the first box, enter my area code, hit tab to go to the next box. But some helpful javascript has already put my cursor into the "next" box, which means I'm now in the third box, and need to back up. Something designed (I guess) to save time has made it take three times as long to fill out the form.

The next time, I remember and decide to be clever. After entering the area code, I wait. But this website doesn't have the evil javascript. The time-saving javascript on the first site has made filling out the form on the innocent website take three times as long.

Re:Clipboard.js: Modern Copy to Clipboard by gregmac on Wednesday September 30, 2015 @11:37AM (#10304713)
> Phone number input boxes like to torture me - the ones conveniently divided into three boxes for the three parts of the number.

If you are a web developer, and you do this: stop.

This works for the North American numbers only. Get a user from the UK and you'll have to undo all this anyways.

Not to mention the complaint in parent's comment, that you can no longer copy/paste, plus the inclusion of javascript to skip to the next box (or the lack thereof) is confusing from a UX perspective.

Allow phone numbers to be entered in any format in a simple text box.

If you want, apply formatting after the fact based on the country, though I think this is even not a good idea. In some cases, the phone number won't be from the same country as the user (with VoIP and mobile, phone number locality is no longer a thing). Dialing formats are also a source of confusion, eg: do you include or require country code?

Re:Clipboard.js: Modern Copy to Clipboard by pdkl95 on Wednesday September 30, 2015 @07:41AM (#10303161)
If there was a Firefox extension that simply disabled 100% of the ability to control or influence the selection, I'd install it in a second.

Manipulating the selection is probably a specific case of the larger problem of terrible, incomplete reimplementations of UI that already exists. This inevitably ends up demonstrating the exact gap between what user environment is, and what the webpage author believes it ought to be.

Re:Clipboard.js: Modern Copy to Clipboard by myfonj on Wednesday September 30, 2015 @09:18AM (#10303659)
From a quick glance it seems quite possible to make such extension: simple dark prototype crippling for inputs and textareas like

    Selection.prototype.addRange = HTMLTextAreaElement.prototype.select = HTMLInputElement.prototype.select = function(){ console.info(this,' arificial selection disabled, sorry.') }
If you use some userscript manager, try it with https://greasyfork.org/en/scripts/12762-disable-arificial-se...
Re:Clipboard.js: Modern Copy to Clipboard by nacs on Wednesday September 30, 2015 @04:03PM (#10306703)
Hate to be that guy but just wanted to point out the typo in the console message/userscript title:

"arificial" should be "artificial" (missing 't').

Re:Clipboard.js: Modern Copy to Clipboard by myfonj on Thursday October 01, 2015 @09:25AM (#10310927)
Hanks for pointing out, good catch! Fixed in userscript, also updated it a bit. Not able to fix it here. Seems like quite frequent mistype BTW :]
Re:Clipboard.js: Modern Copy to Clipboard by pdkl95 on Wednesday September 30, 2015 @09:54AM (#10303936)
Oh, cool! Thanks!
Re:Clipboard.js: Modern Copy to Clipboard by J_Darnley on Wednesday September 30, 2015 @07:44PM (#10308249)
NoScript? If a website doesn't work without JS then is the site worth your time?
Re:Clipboard.js: Modern Copy to Clipboard by svckr on Wednesday September 30, 2015 @09:24AM (#10303713)
GitHub repo URL field got me swearing every single time.

Problem is, even when I'm doing as the field expects me to (as if it had a personality) it does not work, because xterm. So sometimes I end up pasting (ctrl+v) it into the URL bar and copying (=selecting) it again, the old fashioned way. :(

More often than not I don't even bother anymore and type the URL myself.

Re:Clipboard.js: Modern Copy to Clipboard by cobychapple on Wednesday September 30, 2015 @10:18AM (#10304127)
Any repo’s browser’s address bar URL will work as a git clone URL too, if that’s easier for you.
Re:Clipboard.js: Modern Copy to Clipboard by joshdance on Friday October 02, 2015 @03:58PM (#10320902)
Text fields that auto select are annoying, but all of the examples provided here only copy if you click a button.

When there is a long string it is so much easier to just click a button instead of manually selecting the string. Yes sometimes the string is in its own field so you can use Cmd-A but a lot of times it isn't. And overwhelmingly, when someone took the time to think about what would need to be copied, and made it easier, the whole site/tool/process is much better designed.

Re:Clipboard.js: Modern Copy to Clipboard by dijit on Wednesday September 30, 2015 @05:51AM (#10302788)
There are legitimate cases to use something like this;

for example, our organisation has a 'secret server', a centrally audited webserver which stores passwords and controls who can access which passwords.

Personally I think the implementation is shitty.. but without displaying the password in cleartext, copying directly to the clipboard is a preferred solution.

(even if you can potentially mis-paste.)

Re:Clipboard.js: Modern Copy to Clipboard by mnx on Wednesday September 30, 2015 @07:36AM (#10303135)
Is there really any problem with displaying them, after a warning screen of some sort?
Re:Clipboard.js: Modern Copy to Clipboard by dijit on Wednesday September 30, 2015 @08:11AM (#10303303)
I'm not sure, but for me it 'feels' wrong.

since it's not quantifiable I can't really argue against it.. it's just a feeling.

Re:Clipboard.js: Modern Copy to Clipboard by outworlder on Wednesday September 30, 2015 @10:11AM (#10304067)
It is annoying on the open web, and it is usually abused for news sites paywalls' to disable copying or adding boilerplate.

However, it can be useful for web applications. I got a requirement in an internal app to add a button to copy some text in an administrative application. That got scrapped due to the work required to do it reliably without flash.

Re:Clipboard.js: Modern Copy to Clipboard by bwohlergo on Wednesday September 30, 2015 @07:42AM (#10303167)
i loathe confluences code boxes because of autoselect.

i often only want some lines from it... guess what? it selects the hole thing every time you try to explicitly select a small part of it (as in dragging the mouse while clicking over one word = whole document selected)

Re:Clipboard.js: Modern Copy to Clipboard by joshstrange on Wednesday September 30, 2015 @09:26AM (#10303730)
This one is the most annoying to me. For example if I want to use some analytics code but have a plugin or third party (segment.io) that I want to hand off just the "ID" to. If I try to select just the ID as soon as I release the mouse it select the whole thing. I have to copy it all into my note app (nvALT) then select want I want then delete all of it because I have no real desire to save it all as a note. Very irritating.
Re:Clipboard.js: Modern Copy to Clipboard by stevesunderland on Wednesday September 30, 2015 @01:10PM (#10305451)
Hitting CMD+C while selecting the fragment usually works for me.
Re:Clipboard.js: Modern Copy to Clipboard by semi-extrinsic on Wednesday September 30, 2015 @06:42AM (#10302938)
Also, it breaks select + middle-click paste into e.g. vim. The Google Analytics key, for instance, I have to copy into another textbox and then reselect and paste into vim.
Re:Clipboard.js: Modern Copy to Clipboard by avian on Wednesday September 30, 2015 @08:38AM (#10303428)
To paste X clipboard into vim: "+y (if you are using gvim) or i and then ctrl-shift-v (if you are using vim in gnome-terminal).

I used to be a heavy user of select-middle-click copy & paste. But this method of interaction seems to be increasingly broken with each new Firefox release, even without extra Javascript magic.

Re:Clipboard.js: Modern Copy to Clipboard by randlet on Wednesday September 30, 2015 @08:49AM (#10303487)
"+p to paste of course :) That also works in a terminal so you don't have to use ctrl-shift-v.
Re:Clipboard.js: Modern Copy to Clipboard by iridium127 on Wednesday September 30, 2015 @08:44AM (#10303467)
I hate this kind of stuff too but to mitigate this issue you can press <HOME> or <END> on the keyboard.
Re:Clipboard.js: Modern Copy to Clipboard by whoiskevin on Wednesday September 30, 2015 @01:05PM (#10305406)
I agree. Also maybe someone with great UI skills can remember to set a proper damn tab order.
Re:Clipboard.js: Modern Copy to Clipboard by fiatjaf on Wednesday September 30, 2015 @07:37AM (#10303145)
Thank you for saying this.