Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FloatField should use a NumberInput by default #677

Open
azmeuk opened this issue Feb 3, 2021 · 0 comments
Open

FloatField should use a NumberInput by default #677

azmeuk opened this issue Feb 3, 2021 · 0 comments
Labels
bug Unexpected behavior

Comments

@azmeuk
Copy link
Member

azmeuk commented Feb 3, 2021

FloatField uses TextInput but should instead use a NumberInput with step any by default, somewhat like DecimalField does.

Actual Behavior

>>> import wtforms
>>> class F(wtforms.Form):
...     foo = wtforms.FloatField()
>>> F().foo()
Markup('<input id="foo" name="foo" type="text" value="">')

Expected Behavior

>>> import wtforms
>>> class F(wtforms.Form):
...     foo = wtforms.FloatField()
>>> F().foo()
Markup('<input id="foo" name="foo" type="number" value="" step="any">')

Environment

  • Python version: 3.9
  • wtforms version: 3.0.0a1
@azmeuk azmeuk added the bug Unexpected behavior label Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior
Development

No branches or pull requests

1 participant