Skip to main content

Search and Top Navigation

#8041 closed bug (wontfix)

Opened January 20, 2012 05:00PM UTC

Closed January 20, 2012 05:03PM UTC

Last modified March 06, 2013 03:08PM UTC

Spinner: Remove number type

Reported by: jdomnitz Owned by:
Priority: minor Milestone: 1.9.0
Component: [meta] ui.dev Version: git (not yet released)
Keywords: Cc:
Blocked by: Blocking:
Description

When the spinner is applied to an input element which has type = "number" most browsers will display two sets of up/down arrows. The spinner widget should remove the type on create to avoid this glitch.

Attachments (0)
Change History (6)

Changed January 20, 2012 05:03PM UTC by scottgonzalez comment:1

resolution: → wontfix
status: newclosed

Not all browsers support changing the type. The real solution would be to use CSS to change the field back to a text field, but the support for that isn't very good. I've raised concerns with all of the browser vendors about this.

Changed January 20, 2012 05:13PM UTC by scottgonzalez comment:2

This suggestion is also bad, because we'd be breaking expected behavior, such as the APIs that are specific to number inputs. I've created an issue for the standards team to try to improve the situation.

Changed January 20, 2012 07:08PM UTC by jdomnitz comment:3

That is a good point but is there even a solution that would work with older browsers? Changing the elements type works in IE7+, FF, Chrome, Safari and Opera. Using the CSS3 Property appearance is a good html5 solution but would only work in FF10+, IE 10 and Chrome 12?+.

What solution would properly style the browsers with custom GUIs for input type number but no support for the appearance property other then changing the type? I assume the solution needs to support IE 6+, FF 3+, Safari 3.1+ and Chrome.

Additionally, what API's are specific to number inputs but not text inputs? AFAIK the only unique attributes are min and max (which are implemented by the spinner widget itself anyway).

Changed January 20, 2012 07:28PM UTC by scottgonzalez comment:4

Changing the type would kill native methods like stepUp() and it kills validation.

Changed March 04, 2013 05:20PM UTC by AYZ comment:5

It would be good to update the documentation to indicate that 'type="number"' is not supported. A short note would save a lot of developer time ;-)

Changed March 06, 2013 03:08PM UTC by scottgonzalez comment:6

Replying to [comment:5 AYZ]:

It would be good to update the documentation to indicate that 'type="number"' is not supported. A short note would save a lot of developer time ;-)

I've created an issue to track this: https://github.com/jquery/api.jqueryui.com/issues/109

If you have suggestions for the wording, a pull request would be appreciated. Thanks.