[whatwg] <input type=number> without keyboard editing

timeless timeless at gmail.com
Sun Oct 31 21:15:43 PDT 2010

On Mon, Nov 1, 2010 at 4:31 AM, TAMURA, Kent <tkent at chromium.org> wrote:
> A team in Google tried to use <input type=number> for a product, and they
> decided
> not to use it.

> What they needed was a control to select an integer from a specific integer
> range
> such as 1 - 16. The number type control in Opera and WebKit allow a user to
> input
> out-of-range value even if the control has min=1 and max=16 attributes.

> It's not
> a good UI and the reason why they doesn't use type=number.

> They need a number control which
>  - doesn't allow any keyboard / cut&paste operations and
>   So, a text field part is read-only, but the spin-buttons work.

Not allowing cut isn't really reasonable. If you want to prevent cut
from working completely, that's fine.
i.e. when i cut "15" (because i use cut instead of copy consistently),
then your web application is free to reset the value to the default,
but "15" should go into my clipboard.

When I select paste to restore my "15", it needs to work. You don't
have the right to mess with that.

>  - always has a valid value.

set one in onchange

>   "required" by default, and sanitization algorithm may be different.

> I'm not sure how to solve this issue.  Introducing new content attribute or
> another number type?


More information about the whatwg mailing list