-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Describe the bug
When using the specialChar rule and specifying a custom specialCharsRegex, the password only validates after entering 2 characters from the custom list. It works as expected when not specifying custom regex
To Reproduce
Steps to reproduce the behavior:
- Instantiate a PasswordChecklist
- Add the
specialCharrule to the list of rules - Add a
specialCharsRegexprop to the Checklist and give it some regex (copying the default list is fine, for my specific case I wanted to lump numbers into this list, so my regex is/[~`¿¡!#$%\^&*€£@+÷=\-\[\]\\';,/{}\(\)|\\":<>\?\.\_1234567890]/g) - Type a password with one single item from the custom list
- See that the specialChar rule is not met
- Type one more of those characters
- See the specialChar rule now get met
Expected behavior
The specialChar rule should be met when using only one of the special characters, but it only validates after using 2
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: macOS 15.6
- Browser: Chrome, Brave, Safari, FireFox
- react-password-checklist version 1.8.1
Metadata
Metadata
Assignees
Labels
No labels