Setting maxlength attribute dynamically since beta 11
See original GitHub issueI just finished upgrading to ionic2 beta 11 (and angular rc4) changing my forms to @angular/forms.
With the old forms, I was using ion-textarea with a dynamic value to maxlength, e.g:
[attr.maxlength]="VariableThatHoldsMaxLength"
and the maxlength
was copied PROPERLY to the native <textarea>
inside.
Since upgrading to beta 11 - this stopped working and I can no longer set it dynamically - it is not being copied to the native element.
If I set a static value like maxlength="5"
- it is being copied PROPERLY to the native element.
Trying interpolation like maxlength="{{VariableThatHoldsMaxLength}}"
does not work.
Trying “native property” [maxlength]="VariableThatHoldsMaxLength"
also does not work.
Thanks, Eddy
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Setting maxlength attribute dynamically since beta 11 #7635
I'm having a similar issue setting the max attribute dynamically with ion-input type="date", also on beta 11, also with @angular/forms version ...
Read more >Why can I not use dot notation while setting `maxlength ...
I am using Firefox and I wanted to add dynamically created input to the document. I use the dot notation to set attributes....
Read more >ngMaxlength - AngularJS: API
ngMaxlength adds the maxlength validator to ngModel . It is most often used for text-based input controls, but can also be applied to...
Read more >HTML attribute: maxlength - MDN Web Docs
The maxlength attribute defines the maximum number of characters (as UTF-16 code units) the user can enter into an <input> or <textarea> ....
Read more >Dynamically Add/Remove Validators in Angular Reactive Forms
1. “setValidators()” method remove all the previous / default validators from Form Control. For e.g., Suppose during form initialization, you set maxLength and ......
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
It appears between beta.11 and rc.3, the support for the type=“number” attributes (step, min, max) was lost on ion-input.
I am facing the same issue with an
<ion-input type="number">
, I can’t bind to themin
,max
andstep
properties as I described in this forum’s topic.My
@angular/forms
dependency is2.1.1
and myionic-angular
dependency is2.0.0-rc.3
.