Ionic-framework: ion-input: pass HTML5 input attributes to the input

Created on 26 Sep 2016  路  4Comments  路  Source: ionic-team/ionic-framework

Please pass the HTML5 <input> attributes through to ion-input, as done in md-input. The point here is that Angular 2 can use these attributes to match validator directives against, some of which come natively as part of @angular/forms itself. It feels kind of silly a regular <input> now gets more functionality out of the box than the pretty-by-default ion-input does.

Most helpful comment

All attributes should be getting copied down to the native input now. disabled is also being passed down from a form group. If you are still having issues please let me know how I can reproduce it and I'll reopen. Thanks!

All 4 comments

Yes, I agree, FormControlGroup is not able to apply "disabled" feature when you initialize the form group like this

description: [{value:'', disabled: false}, Validators.required]

When you change it to a plain basic input angular2 forms applies the disables ok. This is a great blocking because, if you manually set a [disabled] attribute you start messing with whole form validation status.

Maybe it should follow the logic with buttons

<button ion-button color="secondary" (click)="doSomething()">

All attributes should be getting copied down to the native input now. disabled is also being passed down from a form group. If you are still having issues please let me know how I can reproduce it and I'll reopen. Thanks!

Noob question, but i coulnd't found anything to the topic. Passed down means that I can use it in the html tag as usuall? Because the value attribute here is not working and I wonder why?

<ion-input max="40" placeholder="{{editingPlato.price}}" name="price" value="{{editingPlato.price}}" required ngModel></ion-input>

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

giammaleoni picture giammaleoni  路  3Comments

Nick-The-Uncharted picture Nick-The-Uncharted  路  3Comments

GeorgeAnanthSoosai picture GeorgeAnanthSoosai  路  3Comments

daveshirman picture daveshirman  路  3Comments

manucorporat picture manucorporat  路  3Comments