W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2012

[whatwg] Focus remains on Hidden Element

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 22 Feb 2012 05:27:10 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1202220526280.1688@ps20323.dreamhostps.com>
On Sat, 8 Oct 2011, Kaustubh Atrawalkar wrote:
> 
> In a form element, If a form input element has a focus and its then made 
> hidden using style property display:none the focus still remains on the 
> hidden element. According to specs ( 
> http://www.whatwg.org/specs/web-apps/current-work/multipage/editing.html#focus-management- 
> 4th point) hidden input elements can not be focused. But there is still 
> inconstancy in the browsers.

The spec requires that focus be dropped in this case:

"When an element that is focused stops being a focusable element, or stops 
being focused without another element being explicitly focused in its 
stead, the user agent should synchronously run the focusing steps for the 
body element, if there is one; if there is not, then the user agent should 
synchronously run the unfocusing steps for the affected element only."

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 21 February 2012 21:27:10 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:40 UTC