AstrOOnauta / react-native-international-phone-number

⚛️ International mobile phone number input component for React Native 📱
https://snack.expo.dev/@astroonauta/react-native-international-phone-number
ISC License
272 stars 44 forks source link

RTL Support - swap elements #69

Closed Bilal-Abdeen closed 2 weeks ago

Bilal-Abdeen commented 8 months ago

This fixes #68 Phone numbers (like any number) should be written LTR (Left-to-Right) regardless of the language.

In the component of this library, in RTL (Right-to-Left) mode, the country code (and flag) are displayed on the right side and the phone number on the left side of the screen.

Based on the value of an RTL property, the order of the components is changed.

Obviously, the property "rtl" needs to be added to the props list in the readme file.

Bilal-Abdeen commented 4 months ago

You will also need to add the property rtl to the readme file.

import { I18nManager } from "react-native";

<PhoneInput
  // .....
   rtl={I18nManager.isRTL}
/>
AstrOOnauta commented 2 weeks ago

Hey @Bilal-Abdeen , thanks for this feature! This is amazing!

🚀 AstrOOnauta 🚀