Asa Dotzler: Firefox and more

April 25, 2007

selection in opera

A few weeks back I was running into a problem in Firefox's text selection. If I try to select text that is inside of a link, I either end up inadvertently clicking the link or dragging the link.

It turns out that selecting text inside a link sort of works in Firefox (modulo a regression bug) if you hold down the undocumented alt key.

Keyboard modifiers to mouse behaviors mostly suck. They're pretty much only discoverable so far as reading the manual can be called discovery.

I went to the other browsers to see how they behaved and was pleased to see that at least one other team had actually put in some thought on this problem and implemented an nice solution.

IE and Safari don't even try. Firefox tries, with a keyboard modifier, but that's mostly lame and it doesn't even work right because of a regression bug. Opera's solution is clearly the best.

In Opera, a click and drag that's mostly up or down triggers the drag and drop behavior while a click and drag that's mostly horizontal triggers the selection behavior.

The only change I'd suggest for Opera is that they actually swap out the hand cursor with the caret cursor as soon as that "decision" is made so that it's more obvious that the mode has changed.

This is a practical and elegant solution to a minor problem, one of those finds that makes developing and software fun. It just works. Our goal should be to make everything about the browser work this well.

Posted by asa at 10:36 AM

 

reactions, thoughts, comments, etc.

So have you filed the bug on Firefox?

Posted by: beltzner | April 25, 2007 11:11 AM

Mike, it's already filed but I didn't look it up again for this post. I guess I should have.

Posted by: Asa Dotzler | April 25, 2007 11:19 AM

Sorry, what I should have said was that the bug on the regression that makes the alt behavior not work is already filed. There's also an older bug that discusses different ways to accomplish this. I have not filed the bug that says "make it do what Opera does."

https://bugzilla.mozilla.org/show_bug.cgi?id=50673
https://bugzilla.mozilla.org/show_bug.cgi?id=215926

Posted by: Asa Dotzler | April 25, 2007 11:23 AM

Hasn't this been fixed on the trunk? I believe I read so on mozilla links.

Posted by: David Naylor | April 25, 2007 12:27 PM

Looks like Asa has filed https://bugzilla.mozilla.org/show_bug.cgi?id=378775 on mimicking Opera here.

Posted by: Jesse Ruderman | April 25, 2007 12:56 PM

Also, when a text, that contains links, is selected you shouldn't be able to activate any of the links.

Posted by: Anders | April 25, 2007 1:03 PM

Asa praising Opera...wow. Now if you'll excuse me I have flying pigs to catch...

Posted by: Russell | April 25, 2007 8:14 PM

Amen! Text selection in Firefox is nearly as annoying as its RAM usage :)

Posted by: Donatas | April 25, 2007 9:49 PM

In FX it seems like you drag and drop links (for example to your desktop), just like in IE. I can't see much use for this, but what about horizontal dragging would trigger text select, while vertical dragging would trigger drag and drop like two mouse gestures. Or would that be too complicated? Would at least be awkward if a link is more than one line I guess. But how often does that happen?


- ØØ -

Posted by: Øyvind Ø | April 26, 2007 3:23 AM

David, the closest I remember to this is the non contiguous text selection feature that landed a few weeks ago.

Posted by: Percy | April 26, 2007 5:18 AM

asa2008.jpg

Join Mozilla!