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

 

asa2008.jpg