ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

ion-input clearInput Doesnot Work With formControlName

Open prantikv opened this issue 10 years ago • 3 comments

Short description of the problem:

The clear input cross (X) does not show up ion-input whenformControlName is added.

What behavior are you expecting?

To have the clearInput attribute to work along with model driven formControlName

This works

 <ion-input name="trakingNo" clearInput  type="text"></ion-input>

This Does not

 <ion-input name="trakingNo" clearInput formControlName="modelNo" type="text" ></ion-input>

Which Ionic Version? 1.x or 2.x 2..RC 2

prantikv avatar Nov 08 '16 11:11 prantikv

  • +1 the same problem. Any news @brandyscarney ?

here you have the plunkr that describe the problem:

http://plnkr.co/edit/KGfz9i9uOHrYUZhL6ATL

matejamateusz avatar Jan 18 '17 13:01 matejamateusz

So it seems to behave this way with a formControlName or ngModel. I can see that when you enter a value from nothing ('' -> 'val') it doesn't appear, but if you lose focus and then refocus the input the clear will show.

Created a PR for this here: https://github.com/driftyco/ionic/pull/10121

brandyscarney avatar Jan 21 '17 01:01 brandyscarney

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[bot] avatar Sep 04 '18 13:09 ionitron-bot[bot]