[whatwg] Make stepUp() and stepDown() more developer-friendly

Mounir Lamouri mounir at lamouri.fr
Wed Nov 21 06:12:35 PST 2012

On 20/11/12 22:55, Ian Hickson wrote:
> On Tue, 20 Nov 2012, Scott González wrote:
>> Can you explain why these methods should be no-ops if the value is above 
>> the max or below the min? In jQuery UI, we decided that using these 
>> methods should always result in a valid value.
> I actually missed that in Mounir's suggestion, and the spec now rounds to 
> the nearest allowed value in that case, rather than doing nothing.
> Mounir: is that ok?

As said in my reply to "Forms-related feedback" thread, I think it is
weird to have stepDown() going up or stepUp() going down. Users should
understand that they can't go down if the down arrow isn't doing nothing.
FWIW, this is the behaviour Opera and Chrome UI's have. This is also the
behaviour stepUp() and stepDown() have in Gecko and Presto.

>> I can list out the steps we take for all conditions, but I'd like to 
>> hear everyone's thoughts on the various cases where you're suggesting 
>> that the methods do nothing.
> Mostly I agree with Mounir here, but I'm curious about what you think 
> should happen for the case where there's no value, and the case where the 
> control isn't a numeric/date/time type. I could see an argument for 
> stepping from the default in the former case (Mounir, what do you think 
> about doing that?) but for the latter case I don't really see any point 
> doing anything but throw an exception, as Mounir suggested.

I also replied about the no value case in "Forms-related feedback"
thread. I believe it might be better to set the value to something. I'm
not sure which value should be used for that.


More information about the whatwg mailing list