Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readonly attribute not rendering on ion-input tags #6408

Closed
kubacode opened this issue May 3, 2016 · 16 comments
Closed

readonly attribute not rendering on ion-input tags #6408

kubacode opened this issue May 3, 2016 · 16 comments
Milestone

Comments

@kubacode
Copy link

kubacode commented May 3, 2016

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:

  1. Add an ion input tag with conditional readonly <ion-input [readonly]="isReadonly">
  2. Set isReadonly variable to true
  3. 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

@iignatov
Copy link
Contributor

iignatov commented May 3, 2016

@jgw96 jgw96 added the v2 label May 4, 2016
@gigocabrera
Copy link

+1
Are there any workarounds for this while it gets implemented?

@masimplo
Copy link
Contributor

Any news on this?

@rglaspey
Copy link

Would like to know when this is going to be fixed as well?

@Southpaw17
Copy link

Southpaw17 commented Aug 21, 2016

I would also like to know when this is going to be fixed as well,

@sssemil
Copy link

sssemil commented Sep 8, 2016

Any improvements?

@joeldavuk
Copy link

Even if it did, there's issues in RC4 apparently you can workaround it using custom validators

@mariohmol
Copy link

Ideas for workarounds?

@sjdrew
Copy link

sjdrew commented Oct 5, 2016

would be great to get this fixed.

@sjdrew
Copy link

sjdrew commented Oct 8, 2016

Actually, looks like an oversight. In ionic-angular components/input/ it does not have any code to pass the readonly attribute back to the native angular element. I was able to add that code easily by just duplicating the logic/functions for the disabled attribute.

Attached is diff in case it helps anyone get by for now.

addReadonlyToInput.txt

@manucorporat
Copy link
Contributor

I want to revisit all the inputs before ionic 2.0 final is released:
#8578

@aperezbaena
Copy link

Any forecast of when it will be fixed?

@sudharsanmit
Copy link

sudharsanmit commented Nov 29, 2016

Any estimate of a fix? Just Stuck with it!

@tonyawad88
Copy link

tonyawad88 commented Jan 14, 2017

Any update on this? I have the same issue. The "disabled" tag which I am guessing should act the same as readonly is not working.

<ion-input type="text" [(ngModel)]="lastName" placeholder="Cognome" [disabled]="!isModificationEnabled"></ion-input>

brandyscarney added a commit that referenced this issue Jan 21, 2017
also adds to placeholder test an input and textarea with readonly that
can be toggled

fixes #6408
@brandyscarney
Copy link
Member

@tonyawad88 Can you take a look at my comment here: #10095 (comment)

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: #10120

adamdbradley pushed a commit that referenced this issue Jan 23, 2017
also adds to placeholder test an input and textarea with readonly that can be toggled

fixes #6408
@brandyscarney brandyscarney added this to the 2.0.0-rc.6 milestone Jan 23, 2017
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 4, 2018

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests