ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51k stars 13.51k forks source link

bug: ion-item => ion-invalid style #18426

Closed anleodev closed 4 years ago

anleodev commented 5 years ago

Bug Report

Ionic version: 4.4.2

Current behavior: Using form with formControlName on ion-input, wrapped by ion-item, and setting error for a kind of formControl sets error on ion-input, but ion-item styles are not getting updated until we focuse/unfocuse(blur) an ion-input.

Expected behavior: Styles of ion-item are updated on AbstractControl.setErrors() without any additional actions.

Ionic info: ionic (Ionic CLI) : 4.12.0 Ionic Framework : @ionic/angular 4.4.2 @angular-devkit/build-angular : 0.12.3 @angular-devkit/schematics : 7.1.4 @angular/cli : 7.1.4 @ionic/angular-toolkit : 1.2.2

mrbatista commented 5 years ago

Same problem. The touched property is not set to false when focus input.

Wykks commented 4 years ago

Duplicate of #17414 (Also same problem)

liamdebeasi commented 4 years ago

Hi everyone,

Can you try the following dev build and let me know if it resolves the issue?

npm i @ionic/angular@5.2.0-dev.202006032038.ebb3f9a

The proper solution to this issue is https://github.com/angular/angular/issues/10887, but we are waiting on the Angular team to implement that. In the mean time, this dev build patches the markAs* methods to manually sync Angular's form classes with Ionic's form classes.

liamdebeasi commented 4 years ago

Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic/pull/21429, and a fix will be available in an upcoming release of Ionic Framework.

ionitron-bot[bot] commented 4 years ago

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.