ionic-framework: readonly attribute not rendering on ion-input tags
Short description of the problem:
When conditionally applying the ‘readonly’ attribute to an ion-input, by using the Angular2 syntax [readonly]=“variable”, the ion-input tag does not apply the attribute to the rendered ‘input’ tag.
What behavior are you expecting?
Expect the ‘readonly’ attribute to be rendered on the input tag when “variable” is set to true.
Steps to reproduce:
- Add an ion input tag with conditional readonly
<ion-input [readonly]="isReadonly">
- Set isReadonly variable to true
- readonly attribute is not rendered on the resulting input tag
Which Ionic Version? 2.x
Plunker that shows an example of your issue
http://plnkr.co/edit/xKfiA5wR0aoYsm1n6nxe?p=preview
Run ionic info
from terminal/cmd prompt:
Cordova CLI: 6.1.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.4
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: 1.8.6
ios-sim version: 5.0.8
OS: Mac OS X Yosemite
Node Version: v4.4.2
Xcode version: Xcode 7.0 Build version 7A220
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 9
- Comments: 16 (4 by maintainers)
Commits related to this issue
- fix(input): pass readonly from ion-input down to native input also adds to placeholder test an input and textarea with readonly that can be toggled fixes #6408 — committed to ionic-team/ionic-framework by brandyscarney 7 years ago
- fix(input): pass readonly from ion-input down to native input also adds to placeholder test an input and textarea with readonly that can be toggled fixes #6408 — committed to ionic-team/ionic-framework by brandyscarney 7 years ago
+1 Are there any workarounds for this while it gets implemented?
Any estimate of a fix? Just Stuck with it!
@tonyawad88 Can you take a look at my comment here: https://github.com/driftyco/ionic/issues/10095#issuecomment-274216973
disabled
should be getting passed down now. Please let me know on that issue if it still doesn’t work for you. 😃For this issue, submitted a PR here: https://github.com/driftyco/ionic/pull/10120
Any forecast of when it will be fixed?