W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2010

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

From: Mounir Lamouri <mounir.lamouri@gmail.com>
Date: Tue, 02 Nov 2010 12:14:58 +0100
Message-ID: <4CCFF2B2.6000500@gmail.com>
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
Received on Tuesday, 2 November 2010 04:14:58 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:28 UTC