[whatwg] Placeholder visibility on focus

Thomas Maas thomas at webtypes.com
Tue Jul 19 12:43:41 PDT 2011


On Jul 19, 2011, at 19:12 , Darin Adler wrote:

> On Jul 19, 2011, at 3:55 AM, Thomas Maas wrote:
> 
>> instead of checking for an empty string *and* focus the user agent should just check for an empty string.
> 
> I think that for some user agents, whether the placeholder text is shown when the field is focused should depend on platform behavior.
> 
> For example, Safari has one behavior on Snow Leopard and a different behavior on Lion and I think that is a good thing.
> 
>    -- Darin
> 

Well, the spec is pretty clear on the expected behavior of a user agent. If two user agents behave differently it just means of them isn't following the spec. I'm not sure I see how that's a good thing, but that's a different discussion altogether.

What Kent was suggesting is changing the spec to state that placeholder strings should bel visible on focus. I think that makes a lot of sense.

The only reason I can think of to hide the placeholder on focus is to make it clear to the user that there is no content yet. But that could be solved by styling the placeholder differently on focus or even bring back the current behavior by setting. :focus input-placeholder to display: none.

-Thomas.







More information about the whatwg mailing list