#19686 closed New feature (fixed)

Support HTML5 number input type

Reported by: claudep Owned by: nobody
Component: Forms Version: master
Severity: Normal Keywords:
Cc: charette.s@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In #16630, we added support for type="email" and type="url" HTML5 input types.

This ticket is about type="number" input type. It has been separated so as we can discuss specific issues, in particular localization issues.

Attachments (1)

ticket-19686-claudep-github-revised.diff (38.5 KB) - added by charettes 15 months ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 15 months ago by charettes

  • Cc charette.s@… added
  • Has patch unset
  • Version changed from 1.4 to master

The number input implementation seems to be a bit unstable at the moment.

Chrome implemented it quickly and attempted to localize the input value to the useragent's locale while submitting it the document (or closest parent with a lang attribute) locale. It raised some issues and it's quite hard to work with.

Firefox halted development because many questions arose concerning the decimal mark, group size and separator.

comment:2 Changed 15 months ago by claudep

  • Has patch set

Pull request, with conditional use of NumberInput depending on Field.localize:

comment:3 Changed 15 months ago by charettes

  • Patch needs improvement set

Added some concerns at github.

Changed 15 months ago by charettes

comment:4 Changed 15 months ago by charettes

  • Patch needs improvement unset

Attached a version of claudep's patch with additionnal tests and a fix forDecimalField's input "maxlength".

comment:5 Changed 15 months ago by charettes

All tests pass on Python 2.7.3 SQLite3.

comment:6 Changed 14 months ago by claudep

  • Triage Stage changed from Accepted to Ready for checkin

comment:7 Changed 14 months ago by Claude Paroz <claude@…>

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

In 7ec2a21be15af5b2c7513482c3bcfdd1e12782ed:

Fixed #19686 -- Added HTML5 number input type

Thanks Simon Charette for his help on the patch. Refs #16630.

Add Comment

Modify Ticket

Change Properties
<Author field>
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.