Ticket #8041 (closed bug: wontfix)

Opened 16 months ago

Last modified 3 months ago

Spinner: Remove number type

Reported by: jdomnitz Owned by:
Priority: minor Milestone: 1.9.0
Component: [meta] ui.dev Version: git
Keywords: Cc:
Blocking: Blocked by:

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

comment:1 Changed 16 months ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to wontfix

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 16 months ago by scott.gonzalez

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 16 months 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 16 months ago by scott.gonzalez

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

comment:5 follow-up: ↓ 6 Changed 3 months 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 3 months ago by scott.gonzalez

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.