Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#8041 closed bug (wontfix)

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.

Change History (6)

comment:1 Changed 9 years ago by Scott González

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.

comment:2 Changed 9 years ago by Scott González

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.

comment:3 Changed 9 years ago by jdomnitz

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).

comment:4 Changed 9 years ago by Scott González

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

comment:5 Changed 7 years ago by 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 ;-)

comment:6 in reply to:  5 Changed 7 years ago by Scott González

Replying to 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.

Note: See TracTickets for help on using tickets.