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

bug: form validation not highlighting errors on mode md #23733

Closed
4 of 6 tasks
jongbonga opened this issue Aug 5, 2021 · 5 comments
Closed
4 of 6 tasks

bug: form validation not highlighting errors on mode md #23733

jongbonga opened this issue Aug 5, 2021 · 5 comments
Labels
package: core @ionic/core package type: bug a confirmed bug report
Milestone

Comments

@jongbonga
Copy link

jongbonga commented Aug 5, 2021

Prequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

On ionic Angular, the form fields will highlight red for when .markAllAsTouched() for item mode="md".
After upgrading to v6, the behavior is not experienced anymore. the highlight only shows when fields are focused__

Expected Behavior

The form should show (highlight) errors on the fields when submitted or .markAllAsTouched()

Steps to Reproduce

upgrade ionic angular npm install @ionic/angular@next from v5 to v6

<form (ngSubmit)="onSubmit()" [formGroup]="loginForm">
          <ion-list mode="md">
            <ion-item>
              <ion-label position="stacked" >Email Address</ion-label>
              <ion-input  type="email" formControlName="email"></ion-input>
            </ion-item>
            ...
          </ion-list>
</form>
this.loginForm = this.formBuilder.group({
      email: [
        '',
        Validators.compose([
          Validators.maxLength(100),
          Validators.required,
          Validators.email
        ])
      ]
...
onSubmit() {
    this.loginForm.markAllAsTouched();

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.16.3 (/Users/jonathan/.nvm/versions/node/v16.4.2/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.0.0-beta.2
@angular-devkit/build-angular : 12.1.2
@angular-devkit/schematics : 12.1.2
@angular/cli : 12.1.2
@ionic/angular-toolkit : 4.0.0

Capacitor:

Capacitor CLI : 3.1.2
@capacitor/android : 3.1.2
@capacitor/core : 3.1.2
@capacitor/ios : 3.1.2

Utility:

cordova-res : not installed globally
native-run : 1.4.0

System:

NodeJS : v16.4.2 (/Users/jonathan/.nvm/versions/node/v16.4.2/bin/node)
npm : 7.18.1
OS : macOS Big Sur

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Aug 5, 2021
@liamdebeasi
Copy link
Contributor

Thanks for the issue. Could you reproduce this in an Ionic starter app and provide a link to the repo?

@liamdebeasi liamdebeasi added the ionitron: needs reproduction a code reproduction is needed from the issue author label Aug 6, 2021
@ionitron-bot
Copy link

ionitron-bot bot commented Aug 6, 2021

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please reproduce this issue in an Ionic starter application and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue.

For a guide on how to create a good reproduction, see our Contributing Guide.

@ionitron-bot ionitron-bot bot removed the triage label Aug 6, 2021
@jongbonga
Copy link
Author

@liamdebeasi Please see reproduction here

on click of the login button

v5 on main branch behaves like expected
v6 on v6 branch doesn't validate the fields

@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report and removed ionitron: needs reproduction a code reproduction is needed from the issue author labels Aug 12, 2021
@liamdebeasi liamdebeasi added this to the 6.0.0-beta.5 milestone Aug 20, 2021
liamdebeasi added a commit that referenced this issue Aug 31, 2021
@liamdebeasi
Copy link
Contributor

Thanks for the issue. This has been resolved via #23853, and a fix will be available in an upcoming release of the Ionic Framework v6 beta.

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 30, 2021

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 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
Development

No branches or pull requests

2 participants