[whatwg] Hide placeholder on input controls on focus

Markus Ernst derernst at gmx.ch
Tue Mar 19 02:16:08 PDT 2013

Am 19.03.2013 00:44 schrieb Glenn Maynard:
> On Mon, Mar 18, 2013 at 12:51 PM, Markus Ernst <derernst at gmx.ch> wrote:
>> A reason for the behaviour of Firefox and Chrome may be that some user may
>> not have read the placeholder text before focusing the control. Anyway, if
>> this behavior lets some users think they can't even fill in the form, there
>> must be something wrong about it.
> I've seen browsers (or maybe pages emulating placeholder in script) that
> hide the placeholder text while the input field is focused.  When the
> placeholders are labels for the inputs, it's incredibly annoying to have to
> focus something else in order to see the placeholder text.  If placeholders
> are meant to be useful and not just eyecandy, they need to remain visible
> until the user enters something.

The spec does clearly say: "The placeholder attribute should not be used 
as an alternative to a label."

Thus, the use case you mention is an authoring mistake. I am sure that 
the spec should weigh possible confusion of unexperienced users higher 
than problems caused by authoring mistakes. (Also, misusing the 
placeholder as a label is potentially annoying once the value of the 
control is not the empty string anymore: As you can't even focus 
someting else in order to see the placeholder text, you will have to 
delete whatever you have typed before.)

Anyway, both your and my use cases may be worked around by an obvious 
visual distinction of the placeholder in focused fields. E.g. the 
placeholder text may be rendered almost transparent when the control has 
focus. There must be something that indicates an unexperienced user that 
(s)he can enter text now, which is not the case in the current 
implementations of Firefox and Chrome.

(I must admit I am surprised about this discussion. Huge efforts are 
made in HTML development to enhance accessibility by removing obstacles 
for various groups of users. I am reporting an obstacle. Of course the 
problem will lose weight once placeholders are commonly known, but it is 
still a source of confusion.)

More information about the whatwg mailing list