[Ionic v4-beta.3] ion-input: validation attributes are not working
See original GitHub issueBug Report
Ionic Info
Run ionic info
from a terminal/cmd prompt and paste the output below.
Ionic:
ionic (Ionic CLI) : 4.1.0
@ionic/core : 4.0.0-beta.3
@stencil/core : 0.11.4
aurelia-fetch-client : 1.3.1
choices.js : 3.0.4
handlebars : ^4.0.11
ionicons : ^4.3.0
quill : ^1.3.6
@stencil/sass : ^0.1.0
System:
NodeJS : v8.11.3
npm : 5.6.0
OS : Windows 10
Describe the Bug Form input validation like required, maxlength, min, max, etc. are not working inside a form
Steps to Reproduce
<form>
<ion-list>
<ion-item>
<ion-label position="floating">Input</ion-label>
<ion-input name="input" required maxlength={150} autofocus></ion-input>
</ion-item>
</ion-list>
<button type="submit">Confirm</button>
</form>
Expected Behavior The input field should be validated on form submit.
Additional Context The ion-input is generating two inputs with the same name: one visible input with validation attributes and one hidden input without the attributes. The form is validation only the hidden input.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:6 (1 by maintainers)
Top Results From Across the Web
[Ionic v4-beta.3] ion-input: validation attributes are not working
Run ionic info from a terminal/cmd prompt and paste the output below. ... The input field should be validated on form submit. ......
Read more >Ionic 3 validation is not working on "invalid && dirty"
I am trying to implement a validation for inputs in Ionic. For some reason the validation is not firing up. Please see my...
Read more >ion-item - Ionic Framework
ion -item elements for iOS/Android contain text, icons, images, and other custom elements. They're placed in a list and can be input, deleted,...
Read more >Advanced Forms & Validation in Ionic & Angular | Josh Morony
A FormControl is tied to an input field, it has a value (i.e. the value the user has entered), and a validation state...
Read more >Ionic Tutorial - Forms and Validations in ionic 5
You won't find the timing issues that sometimes affect a template-driven form. Also, reactive forms can be easier to unit test.
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 FreeTop 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
Top GitHub Comments
The min and max properties also doesn’t work: The input accepts values over 999. The form keeps valid. Tested on BETA-11:
<ion-input type="number" min="0" max="999"></ion-input>
This should be fixed now that shadow-dom has been disabled for ion-input!