[whatwg] Hide placeholder on input controls on focus
glenn at zewt.org
Fri Mar 22 15:32:33 PDT 2013
On Tue, Mar 19, 2013 at 4:16 AM, Markus Ernst <derernst at gmx.ch> wrote:
> 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.
This is a styling and UX decision to be made by authors, not by the HTML
specification. This is only UX advice ("should", not "must"); it's not an
authoring mistake to have a different opinion on it.
> 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.)
I start typing after I read the placeholder. Hiding placeholder text just
because I focused the input is wrong; I may not have read it yet.
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.)
Both Firefox and Chrome put the placeholder text in grey to distinguish it
from user-entered text. The subject line says "Hide placeholder on input
controls on focus", and that's not a good idea.
In any case, how placeholders are styled should remain up to the
implementation. This isn't a spec issue.
More information about the whatwg