react-native-ui-lib icon indicating copy to clipboard operation
react-native-ui-lib copied to clipboard

fix: Allow empty strings for email and number validation in validators.ts

Open abdulbasithqb opened this issue 2 years ago • 3 comments

Description

Updated the email and number validators in validator.ts to allow empty strings. Now, empty email and number strings are considered valid.

Motivation

issue #2807

Changelog

  • Modified the email validator logic to allow empty strings explicitly.
  • Modified the number validator logic to consider empty strings as valid.

Additional info

This change ensures a more permissive validation for both email and number fields. If a field is not required, no error message will be displayed when users clear their input. If you encounter any issues or have further suggestions, please let me know.

Results

1. Invalid Email 2. Invalid Number
1. Email Cleared 2. Number Cleared

abdulbasithqb avatar Nov 17 '23 07:11 abdulbasithqb

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 13 '24 10:03 stale[bot]

Thank you! @Inbal-Tish @adids1221 could you please take a peek whenever able 🙏 ? This one has been open for a few months now

brianangulo avatar Mar 20 '24 16:03 brianangulo

Left another small comment since it could be a breaking change to other users that are using this validation even though the email field isn't required.

changes are made as per the suggestion

abdulbasithqb avatar Mar 21 '24 09:03 abdulbasithqb