-
Notifications
You must be signed in to change notification settings - Fork 139
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
#3494 sync businessPhone validation with member api #3507
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yoution the fix itself works good for me. Though implementation doesn't use formsy which is used to implement PhoneInput field.
To check valid/not valid you've added one more custom argument isValid
. Though formsy already supports adding validators https://github.com/christianalfoni/formsy-react. So the code can be reimplemented the next way:
- Instead of implementing a custom method
checkPhone
implement a standard formsy method `validate which would be check phone number as per regexp - then I guess, we don't need to add
isValid
anymore anywhere, as vlidation would be work automatically - in some reason, detecting the country code doesn't work on the Registration page anymore. Before it worked https://monosnap.com/file/hUsszKEaxQh1Mv42t7GGtFJDmqjmN5, but after fix it doesn't work https://monosnap.com/file/Rppv6d8nxp5kQjHWWPewkmbTUQhBW6
Also, please, check the comments below in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All works good.
As has been discussed in comments, it looks like it's not possible to include validation rule inside the component, other than creating checkPhone
method.
@maxceem no, it not work good, I lost the country code validate in this repo, so I push again |
Thanks, @yoution. On registration page works perfect now: validaties both code and phone with regexp. On the profile settings page, it does validate code, but doesn't validate phone with regexp: if enter phone with valid country code, but after I add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works good.
#3494