[whatwg] Hide placeholder on input controls on focus
ian at hixie.ch
Tue Jul 30 15:50:53 PDT 2013
On Mon, 18 Mar 2013, Markus Ernst wrote:
> On several occasions I encountered that users got confused by the
> placeholders on input fields. In a doodle.com survey last week, 2 out of
> 5 people answered me via e-mail that they were not able to fill in their
> names in the "name" field, because they tried to highlight and delete
> the placeholder saying "Your name".
> Also, some months ago I had phone calls from clients who were desperate
> because they thought they weren't able to log into their Hotmail
> accounts anymore, for the same reason (I think Hotmail has made the
> placeholder highlightable since then).
> It seems that a relevant number of users do not even try to start typing
> as long as the placeholder text remains visible.
This would be good feedback to provide to the browser vendors, so that
they adjust their interface accordingly.
> Thus I'd suggest to modify the following sentence in 22.214.171.124.10:
> 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 or the
> control is not focused (or both), e.g. by displaying it inside a blank
> unfocused control and hiding it otherwise.
> ...when the element's value is the empty string _and_ the control is not
> focused, e.g. by displaying ...
The idea is to allow multiple behaviours. The user agent is supposed to do
what the user wants -- if a user wants a browser that shows the
placeholder when they've focused the control and are staring at it trying
to work out what to do next, then they should be allowed to have such a UA
(at a minimum, by writing it themselves), without it being non-conforming.
At the end of the day, there are valid arguments for both behaviours as
well as many others (e.g. showing the placeholder in a bubble under the
input control when you focus it, or having it slide to the right of the
control when you click on it, or having the placeholder disappear when you
click on the control and then reappear if you don't change anything, or
having a separate part of the screen be a kind of running commentary of
what's going on, and having the placeholder appear there when you hover
over the control, or...). It's up to the UAs to pick the right behaviour
for their users.
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg