[whatwg] Placeholder visibility on focus

Ian Hickson ian at hixie.ch
Fri Jan 20 12:51:23 PST 2012


On Tue, 19 Jul 2011, TAMURA, Kent wrote:
> 
> http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#the-placeholder-attribute
> >  User agents should present this hint to the user, after having stripped
> > line breaks from it,
> > when the element's value is the empty string and the control is not
> > focused (e.g. by
> > displaying it inside a blank unfocused control).
> 
> I'd like to propose to change this part so that we allow UAs to show
> placeholder text even if the control is focused.
> 
> * This behavior might depend on platforms.
>   The password field of Windows 7 logon screen shows placeholder text when
> the field is focused.
> 
> * autofocus + placeholder is useless in the current specification.

I have since changed it to "and/or" rather than just "and".


On Tue, 19 Jul 2011, Thomas Maas wrote:
> 
> a placeholder is supposed to give a hint. It's not logical to hide the 
> hint before you actually add content. As the act of adding content 
> probably means you understood the hint, not the act of focussing.

I left the option of having the hint even when there's a value since 
the value could come from the server (a default) rather than the user.


In general this is a UA UI issue so I don't want to overconstrain this. If 
there's a use case for UIs that aren't allowed in the spec as it stands, 
I'm happy to loosen it further, let me know.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list