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

Mounir Lamouri mounir.lamouri at gmail.com
Tue Nov 2 04:14:58 PDT 2010


On 11/01/2010 08:15 AM, Jonas Sicking wrote:
> On Sun, Oct 31, 2010 at 7:31 PM, 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.
>>  - always has a valid value.
>>   "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?
> 
> Do you really want to disallow keyboard editing, or do you just want
> to disallow entering an out-of-range number? The latter should be
> prevented by a proper implementation of <input type=number>. If that
> is not the case in webkit or opera then I suggest you file bugs on
> those implementations.

I'm not sure that disallowing out-of-range numbers would be the best
implementation but if all implementations concur to that, maybe the
specifications should reflect that and disallow out-of-range values like
it's asking for valid floating point numbers value. For the moment,
using a simple event handler should fix it.

--
Mounir



More information about the whatwg mailing list