-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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: ion-input new v7 errorText displayed right away #26939
Comments
(Another solution would be to introduce a new property, like |
Thanks for the report. Here is a dev build if you are interested in testing the proposed fix:
|
I confirm it works with the dev build, thanks! |
Thanks for the issue. This has been resolved via #26940, and a fix will be available in an upcoming release of Ionic Framework. |
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. |
Prerequisites
Ionic Framework Version
v7.x
Current Behavior
v7 introduced
errorText
property to<ion-input>
. But if the input has therequired
attribute, which is one of the most basic and common control, theerrorText
will be displayed right away when the form is displayed. This is problematic for several reason:<ion-input>
behavior introduced in v7, as it forces to add back a<ion-item>
with<ion-note slot="error" *ngIf="emailControl.invalid && emailControl.dirty">
(assuming it's still possible, which is not even sure, it doesn't work in v7 in my application anymore, probably because you can't mix the 2 systems)Expected Behavior
<ion-input>
errorText
should behave like CSS, ie. be displayed only when the input is invalid and touched and moved away to another input.Steps to Reproduce
<ion-input type="text" label="text" name="hello" required errorText="Error" [(ngModel)]="hello">
(sorry I tried to do a stackblitz but I couldn't make it work with ionic v7 and I have no more time to create a full github repo)
Code Reproduction URL
No response
Ionic Info
@ionic/angular
v7.0.0-rc.1@angular/*
v15.2.2xnode v18.15.0
npm v9.6.0
Additional Information
No response
The text was updated successfully, but these errors were encountered: