AddressSheet allows incomplete phone number on Android when phoneNumber = optional
kaitlyn-lighthouse opened this issue · comments
Describe the bug
On Android, passing the prop additionalFields={{ phoneNumber: "optional" }}
to the AddressSheet component allows users to submit the address with an incomplete phone number. The expected behavior is what happens on iOS, where the user can submit with a blank phone number, or a valid phone number, but not an incomplete one.
To Reproduce
Steps to reproduce the behavior:
- Create an AddressSheet with the prop
additionalFields={{ phoneNumber: "optional" }}
- Run the app and open the address sheet
- Enter a valid address without a phone number. The "Save address" button should not be disabled
- Enter an incomplete phone number into the phone number field (e.g., "123"). The "Save address" button should be disabled, but it is not.
Expected behavior
Whenever a valid address (excluding phone number) is already entered, the "Save address" button should be enabled only if the phone number field is empty, or if the phone number entered is the correct length.
Smartphone:
- Device: Pixel 7A
- OS: 14
- Not in browser, in expo-managed react native app