[whatwg] Hide placeholder on input controls on focus

James Ross whatwg-20070806 at james-ross.co.uk
Thu Mar 21 04:10:37 PDT 2013

> From: kit at iqmultimedia.com.au
> To: rescator at emsai.net; derernst at gmx.ch
> Date: Thu, 21 Mar 2013 01:18:26 +0000
> CC: whatwg at lists.whatwg.org
> Subject: Re: [whatwg] Hide placeholder on input controls on focus
> I'm skeptical that this is genuinely a significant issue with users, chiefly because I've never really seen any page authors feel the need to implement anything like this, and because as stated earlier Safari, Firefox and Chrome all use non-hiding placeholders in various places in their browser chrome without any sort of special treatment on focus.
> Surprisingly, the only example I could find of a developer doing something both on focus *and* once the user starts typing is Opera in its address bar and search field, which behaves as you describe; the placeholder text goes lighter on focus.
> Nevertheless, the _only_ browser I can find which actively removes its placeholder text on focus is IE 8 (in its search field). I can't believe that there needs to be a different implementation for fields in the browser's own chrome as for in-page form fields.

Just as an added data-point (that I only noticed today) - Windows 7's placeholder implementation in the Start menu and Explorer's search box:
 - The text is displayed in grey *and* italic *and* with a space at the start.
 - Focusing the input box with tab/Control-E or autofocus when opening the Start menu does *not* hide the placeholder.
 - Typing hides the placeholder and clearing to empty re-shows it.
 - Control-A or clicking in the textbox hides the placeholder.

This to me seems like a very interesting compromise between the two observed behaviours in browsers - autofocus does not prevent the user seeing the placeholder but any attempt to interact with it (by typing, mouse clicking or control-a) removes it.

I would be interested in why this behaviour was not adopted in IE10's input[placeholder] implementation.

James Ross silver at warwickcompsoc.co.uk 		 	   		  

More information about the whatwg mailing list