Open
Description
Plugin Version
v25.2.1
Steps to Reproduce
- Initialize the plugin with the following options:
validationNumberTypes: null, strictMode: true,
- Add a phone number to the text field, including the country code (e.g.,
+1 12345678901234567890
). - Observe that the strict mode validation fails to enforce the number length.
Expected Behavior
Strict mode should validate the phone number properly, even when a country code is present in the field. The length and type of the number should adhere to the validationNumberTypes
configuration.
Actual Behavior
When a country code is included in the field, the number length appears to be unlimited, and strict mode validation does not work as expected.
Initialization Options
The following options are used for initialization:
validationNumberTypes: null,
strictMode: true,
Additional Notes
- It seems that the country code is not being correctly factored into the validation logic when
strictMode
is enabled. - The expected behavior should validate the full number, including the country code.
Proposed solution
After looking at the code I think we can get the number ignoring the country code and check if it's within the length and stop user from entering more number.
#1932
Metadata
Metadata
Assignees
Labels
No labels