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

[whatwg] Allow empty string for input type=color

From: Shaun Moss <shaun@astromultimedia.com>
Date: Fri, 04 May 2012 04:33:02 +1000
Message-ID: <4FA2CF5E.4060207@astromultimedia.com>
The way things are done is not always the best way. Most colour pickers 
are used in instances where "not selected" would make no sense.

However, as you're designing a widget for the web that may be used by 
billions of people in any number of unforeseen ways, flexibility is a 
virtue, and the option to clear the field would be an improvement. If 
you don't allow a "not selected" or null option, this would basically 
force all colour widgets to be required fields, which may not be what 
the form designer wants.

To compare, some date pickers do not allow you to clear the field, but 
some do. For the web, it's a useful feature.


On 2012-05-03 11:46 PM, Anne van Kesteren wrote:
> On Thu, 03 May 2012 02:10:11 -0700, Markus Ernst <derernst at gmx.ch> wrote:
>> If I understand the spec correctly, entering no value defaults to 
>> #000000, thus the required attribute does not apply. What are the 
>> reasons for this? I am sure there were good reasons to specify it 
>> this way, anyway I don't see them right now. "Not selected" is 
>> actually very different from "black".
> "Not selected" is not something typically supported by native color 
> pickers.

Shaun Moss
+61 405478912
skype: mossy2100
groups.drupal.org: mossy2100
Received on Thursday, 3 May 2012 11:33:02 UTC

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