bug: Input type number is not respected
See original GitHub issueType: <span ionic-type>bug</span>
Ionic Version: <span ionic-version>2.x</span>
Platform: <span ionic-platform>all</span>
<span ionic-description>Steps to reproduce:
- Create an
ion-input
withtype="number"
- Add
[(ngModel)]
and(ngModelChange)
to get the Value of the input - Check the type of the value using
typeOf(value)
- Type in a number into the input => Type is always a string
Expected behavior: … => Type is a number.
See this plunk as an example: https://run.plnkr.co/plunks/GHBFad/</span>
<span is-issue-template></span>
Issue Analytics
- State:
- Created 7 years ago
- Reactions:8
- Comments:28 (12 by maintainers)
Top Results From Across the Web
bug: Input type number is not respected · Issue #7121 - GitHub
Ideally, the input value property should be string | number and not just string . And the data returned to the handler should...
Read more >Chrome/HTML5: Input type number not respecting max ...
Chrome/HTML5: Input type number not respecting max attribute? · Works fine for me, I get the error message "Value must be less than...
Read more >Why the number input is the worst input - Stack Overflow Blog
When the number input contains an invalid value and you retrieve the value, you get a blank string ... If you are building...
Read more >Bug found: Form - no validation for input field type: "Number"
When you set an inputfield type to "Number", and submit the form without a valid number, no validation is made, no error message...
Read more >HTML5 Form Validation With the “pattern” Attribute - Web Design
Whenever the value given is not met with the expected formatting, these input types will throw an error message thus preventing submission.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I confirmed this is still an issue with latest.
workaround:
Template:
Function:
hope this helps.