-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If the device's direction is RTL, input is reversed. #70
Comments
Hello @Bilal-Abdeen , Thanks for your contribution! Next version this will be up. |
@AstrOOnauta Thank you very much for implementing my PR 69. However, this PR fixes issue #68. However, this issue is still there. Please open it again. By the way, I think the problem is in the masking function algorithm. However, I could not find which part of the code needs updating. |
Hey @Bilal-Abdeen ...let me know if I understand this: in RTL mode the phone number is displayed in reverse mode? likes the number 123456789 (LTR) will be 987654321 (RTL)?? |
@AstrOOnauta Thank you for the great library, @Bilal-Abdeen Thank you for your work, regarding the issue I also had to manually alter the library to support this, I also added a functionality to change arabic numbers(١٢٣٤) to (1234). |
It is reversed only when a mask with a space is used. So, (123 456) is displayed as (456 123.) |
@PPHelios Ooh great! When you have a time, please..share your logic! Thanks for this... @Bilal-Abdeen Understand, this is so crazy :O |
@Bilal-Abdeen I also ultered the mask as some users use 0 before the number which excheeds the mask length and some didn't. |
Yes, please share your code. I will see if I and/or @AstrOOnauta can make a PR of it. |
It seems very strange. I found the same issue in other phone number libraries. I think it has something to do with an auto-reverse functionality of React-Native when RTL is used. |
@Bilal-Abdeen @AstrOOnauta I'm sorry not to create a repo and contribute on this as I'm currently working on a project, |
@PPHelios Thank you very much for sharing your version of the library. I installed it. It does fix the order of the 3 visual components (flag, country code & phone number.) I liked your smart solution of using The screenshot you shared with us shows an important fix for another issue (the mask parts reversed.) I used your version, but sill have the issue!. Am I missing something? How did you fix this in your project? To make sure we are talking about the same thing, I am talking about the following problem.
Your input is highly appreciated! |
@Bilal-Abdeen I didn't do anything special regarding using the component, the direction of numbers should be handled by the system, i will include my component maybe I forgot something. I don't know if it's the cause but why don't you try switching the language directly from the app.
|
@PPHelios Thank you very much for sharing that. Can you, please, send the code for the following functions? |
@Bilal-Abdeen onChange comes from "react-hook-form". Find below the toEnDigit function |
@PPHelios Thank you for that. I am not sure I understand what you mean by |
@PPHelios and @AstrOOnauta, <PhoneInput
....
phoneInputStyles={{ flagContainer: { width: 120, }, }}
/> This is strange. This styling is applied to For now, it seems that using |
Thank you for the excellent library. If the user has an RTL (Right-To-Left) language as the default language on the device, the different parts of the phone number are reversed. For example, if the user enters
123 456
, this library displays456 123
. This occurs regardless of the app's support for RTL!To reproduce:
<PhoneInput>
. What will be displayed is 456 123.Notes:
customMask
with no spaces, e.g."#######"
, can be used as a workaround. However, we lose the excellent masking capability of the library!TextInput
component fromReact-Native
works fine! I could not find which part of the library's code causes the issue.The text was updated successfully, but these errors were encountered: