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

ValidationTrigger.changeOrFocusout doesn't clear the errors when refocusing an input and writing into it #1470

Closed
IonelLupu opened this issue Jun 20, 2022 · 4 comments · Fixed by #1472
Assignees

Comments

@IonelLupu
Copy link

IonelLupu commented Jun 20, 2022

🐛 Bug Report

When using the ValidationTrigger.changeOrFocusout trigger, refocusing an input after it's invalid and writing in it, won't make the error go away

Replicate steps:

  • open the Stackblitz link
  • click Submit. The errors should display under each input
  • write less that 10 characters in the last input. All the errors should still be there
  • click on the second input (or any other input) and add something to it
  • click on the last input again and add more characters until you have more than 10. Watch the error not disappearing. It should go away.

PS. focus out and now the error should disappear.

(This is not the same behavior as in AU1)

🤔 Expected Behavior

Expecting the error message to go away.

😯 Current Behavior

The error message is still visible

💁 Possible Solution

🔦 Context

💻 Code Sample

Stackblitz

🌍 Your Environment

(refer to Stackblitz)

Software Version(s)
Aurelia
Language
Browser
Bundler
Operating System
NPM/Node/Yarn
@Sayan751
Copy link
Member

Note that you have used a .min validation rule on the address field, which is of string type. What you need ideally is .minLength. Check this out: https://stackblitz.com/edit/au2-validation-validation-validationresultpresent-ttnjzj?file=src%2Fmy-app.html,src%2Fmy-app.ts

With .minLength it is working correctly.

@IonelLupu
Copy link
Author

@Sayan751 You are right. I copied the wrong validation rules from my code. I updated the stackblitz link above. Retry the steps again pls. You will now see the error better

@Sayan751
Copy link
Member

@IonelLupu I have corrected another inapplicable validation rule for age; there .min is expected, as it is of number data type. But I cannot still reproduce the error and just to ensure that we are not trying different steps, here is GIF of my steps.

au2-validation-gh-1470

@IonelLupu
Copy link
Author

IonelLupu commented Jun 21, 2022

hey @Sayan751 . My steps were actually wrong. I updated them now above. In the steps where it says "click on some other input" it should also have been "and add something to that input"

20220621232659.mp4

@Sayan751 Sayan751 self-assigned this Jun 22, 2022
Sayan751 added a commit that referenced this issue Jun 22, 2022
bigopon pushed a commit that referenced this issue Jun 24, 2022
* fix(validation-html): validate BB trigger

Closes #1470
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants