W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

[whatwg] Should editable elements have placeholder attribute?

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Tue, 1 May 2012 23:59:06 -0700
Message-ID: <CABNRm61a_qLnjVu0Su6Xdy=-QrMPi7S8QE163=3trzdWZ6RUQw@mail.gmail.com>
On Tue, May 1, 2012 at 11:09 PM, Aryeh Gregor <ayg at aryeh.name> wrote:

> On Wed, May 2, 2012 at 8:00 AM, Ryosuke Niwa <rniwa at webkit.org> wrote:
> > Would it be useful to have placeholder content attribute on elements that
> > are editable? (i.e. contenteditable=true).
> >
> > According to the original WebKit bug
> > 21286<https://bugs.webkit.org/show_bug.cgi?id=21286>,
> > this may reduce the amount of code authors have to write.
>
> This sounds like a good idea to me.
>

Great. I think the tricky part will be defining exactly how and when the
placeholder is displayed.

e.g. Should it be treated as if there is a text node in the editable
element? Should we ignore things like "<br>" or collapsible spaces when
determining whether the element is empty or not?

- Ryosuke
Received on Tuesday, 1 May 2012 23:59:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:08 GMT