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

feat: add validate input on blur #8091

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ntsd
Copy link

@ntsd ntsd commented Feb 24, 2024

before the input validation on submit.

This PR makes it validate on input blur, I have tried the on:change event but after focusing on the input again the error is gone and if the input didn't change it does not trigger validate again.

Summary

Validate input on blur instead of on submit

image

Changelog

- Add validation on amount and recipient input

Testing

Platforms

Please select any platforms where your changes have been tested.

  • Desktop
    • MacOS
    • Linux
    • Windows

Checklist

Please tick the following boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or modified tests that prove my changes work as intended
  • I have verified that new and existing unit tests pass locally with my changes
  • I have verified that my latest changes pass CI workflows for testing and linting
  • I have made corresponding changes to the documentation

ntsd added 2 commits February 24, 2024 22:30
before the input validate on submit, this commit make it validate on input blur, I have tried on change but after focus on the input again the error is gone. and if the input didn't change it's not trigger validate again.
Copy link
Collaborator

@marc2332 marc2332 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is great, but I find the way you propagate upwards the blur event is somewhat hard to understand why it's there unless you see the big picture, is there maybe a better way to do this?

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 this pull request may close these issues.

2 participants