[whatwg] datalist @exclusive [was: Please reconsider: Set restricted palette for input type=color]

Jukka K. Korpela jkorpela at cs.tut.fi
Tue Mar 8 21:51:48 PST 2011


Jonas Sicking wrote:

> I'm having a little bit hard of a time figuring out what a good UI
> would look like in the general case. I.e. what should the UI look like
> for
>
> <input type="date" id="date" name="date"
> value="2011-04-01" list="datelist" exclusive>
> <datalist id="datelist">
> <option value="2011-04-01" label="April 1st">
> <option value="2011-04-08" label="April 8th">
> <option value="2011-04-09" label="April 9th">
> <option value="2012-06-06" label="National Day of Sweden">
> </datalist>
>
> Do you allow flipping between only the months which have any available
> dates in them using the next/previous month buttons in the date
> picker?

That would be the idea, I guess, but there are two alternatives regarding 
months that have no applicable days: either skip them or gray them out. So 
in your example, when in April 2011, "Next month" button could take you to 
June 2012, or it might take you to to May 2011 with all days grayed out

> That seems like it could be somewhat confusing.

Mildly, I would say, and the example is somewhat anomalous. In typical use 
cases, dates are relatively close to each other.

> And how/where do you show the labels?

They could be shown on mouseover. Alternatively, a <datalist exclusive> 
could be implemented as a dropdown or listbox, showing the labels (or, in 
their absence, the value attributes) as selectable items.

> Or do you do some type of dropdown without a date picker at all?

That would be an acceptable implementation.

> How would that be different from just a <select>?

<Select> is generic, like <input type="text">, as opposite to <input 
type="date">, <input type="color"> etc. So an implementation cannot 
implement <select> in a content-aware way, like a date or color picker, but 
it can (and hopefully will, but it is not required to) implement e.g. <input 
type="date"> with associated <datalist> as a date picker with some dates 
highlighted and possibly (when the proposed new "exclusive" attribute is 
used) all other dates grayed out.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/ 



More information about the whatwg mailing list