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
specialChar rule to the list of rules
- Add a
specialCharsRegex prop 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
Describe the bug
When using the
specialCharrule and specifying a customspecialCharsRegex, the password only validates after entering 2 characters from the custom list. It works as expected when not specifying custom regexTo Reproduce
Steps to reproduce the behavior:
specialCharrule to the list of rulesspecialCharsRegexprop 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)Expected behavior
The
specialCharrule should be met when using only one of the special characters, but it only validates after using 2Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):