stripe / stripe-react-native

React Native library for Stripe.

Home Page:https://stripe.dev/stripe-react-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  1. Create an AddressSheet with the prop additionalFields={{ phoneNumber: "optional" }}
  2. Run the app and open the address sheet
  3. Enter a valid address without a phone number. The "Save address" button should not be disabled
  4. 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.

Screenshots
Screenshot_20240625-153056

Smartphone:

  • Device: Pixel 7A
  • OS: 14
  • Not in browser, in expo-managed react native app