Bug 23145 - retain focus after unintentional onblur to allow directional pad navigation
Summary: retain focus after unintentional onblur to allow directional pad navigation
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 23163
  Show dependency treegraph
 
Reported: 2009-01-06 12:46 PST by Cary Clark
Modified: 2010-01-28 08:31 PST (History)
1 user (show)

See Also:


Attachments
ignore onBlur() clearing focus for directional pad navigation (2.20 KB, patch)
2009-01-06 12:54 PST, Cary Clark
adele: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cary Clark 2009-01-06 12:46:51 PST
Android uses a directional pad to move focus spatially, and interprets the directional pad center button as a mouse click on the center of the current focus. 

http://tools.arantius.com/stopwatch
includes this:
<div id='main'>
	<button type='button' onclick='ss()' onfocus='this.blur()'>Start / Stop</button>
	<input type='text' id='disp' />
	<button type='button' onclick='r()' onfocus='this.blur()'>Reset</button>
</div>
So, when using a directional keypad to gain focus on the Start or Reset button, the onfocus attribute removes the focus. This patch ignores the part of blur which clears the document focus if the element does not have an onBlur attribute.

I'm not particularly proud of this fix, but don't have an alternative. What can I do to improve on this patch?
Comment 1 Cary Clark 2009-01-06 12:54:47 PST
Created attachment 26468 [details]
ignore onBlur() clearing focus for directional pad navigation
Comment 2 Adele Peterson 2009-03-23 11:38:21 PDT
Comment on attachment 26468 [details]
ignore onBlur() clearing focus for directional pad navigation

I don't think its wise to ignore blur in this case.  This seems more like a site bug to me.  In Safari, the site won't let you tab to focus those buttons either, so there would be no way to activate the button without a mouse.  I guess the real problem here is that there's no way to tell that this is really an unintentional blur.  If it is unintentional, the site should fix it.
Comment 3 Cary Clark 2010-01-28 08:31:33 PST
Android no longer moves the focus with the direction pad so this is obsolete.