Ionic-framework: ng-touched applied to ion-input on keyup instead of blur as of release 3.4.0

Created on 20 Jun 2017  路  11Comments  路  Source: ionic-team/ionic-framework

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[X] 3.x

I'm submitting a ... (check one with "x")
[X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
ng-touched is being applied to ion-input fields on keyup

Expected behavior:
ng-touched should be applied to ion-input fields on blur

Steps to reproduce:
The bug is present in [email protected], but _NOT_ present in [email protected].

Create a basic formBuilder form, start typing into ion-input field. ng-touched is added on keyup. Start typing into standard input field, ng-touched is added on blur.

http://plnkr.co/edit/8NtRId4YGbhXTHcWOMfV?p=preview

Other information:
Bug was introduced in release 3.4.0 as it works as expected in 3.3.0.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 6.5.0
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.2.3 ios 4.4.0
    Ionic Framework                 : ionic-angular 3.4.0

System:

    Node       : v6.9.1
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.3 Build version 8E3004b
    ios-deploy : 1.9.1
    ios-sim    : 5.0.13
    npm        : 3.10.8

Most helpful comment

@mhartington is there any progress as this is really an annoying issue?

All 11 comments

@manucorporat

Hi. Just to confirm this happens with Ionic 3.4.2 as well.

I have the same problem with ionic 3.4.2...

Yep, same here! I can confirm this is still an issue in 3.5.0 and 3.6.0

The attibute _isTouch in TextInput has changed, but not the ngTouched... I think my PR #12315 solve this.

@manucorporat plz, can you check my PR? #12315

Hey folks! Sorry this feel under that radar. @RodolfoSilva we'll look at your PR and give it a test.

@mhartington is there any progress as this is really an annoying issue?

Hi @kensodemann
I just noticed you released the 3.6.1 before including this fix.
May I suggest this fix is important enough to justify a 3.6.2 release as soon as possible?
Thanks.

@ddahan - this fix was intentionally delayed until after the 3.6.1 release because of timing, ability to fully test, etc. This will be included in a 3.6.2 release at some point in the near future (think weeks rather than months). There are a couple of other important items that are being wrapped up to be included in that release. I'll report back later on how that is going.

@kensodemann, problem isn't solved. After manually setting controls to touched, there is no updates in UI.

  for (var controlName in this.productForm.controls) {
      this.productForm.controls[controlName].markAsTouched();
    }

template:

 <form [formGroup]="productForm"
        (ngSubmit)="onProductSubmit()">
    <ion-list>
      <ion-grid>
        <ion-row>
          <ion-item no-lines>
            <ion-label>楔褌褉懈褏-泻芯写</ion-label>
            <ion-input type="text"
                       formControlName="code"></ion-input>
          </ion-item>
        </ion-row>
...

"ionic-angular": "3.9.2",

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