Skip to content
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

RTL text direction #4753

Open
1 task done
codokie opened this issue Feb 20, 2025 · 5 comments
Open
1 task done

RTL text direction #4753

codokie opened this issue Feb 20, 2025 · 5 comments

Comments

@codokie
Copy link

codokie commented Feb 20, 2025

Steps To Reproduce

To reproduce the bug with a vault item:

  1. Change app language to a language with an RTL script such as Hebrew or Arabic, or enable "Force RTL layout direction" in Android's Developer Settings
  2. Open Bitwarden (and unlock vault)
  3. Create a new login vault item with the following details and save it:
  • Name: not applicable (just type something)
  • Username: _user
  • Password: pass*
  • URL: https://bitwarden.com/ (don't forget the ending slash)
  • Custom field (text): $custom-text@#
  1. Open the newly created vault item and examine its username, password, URL and custom field

To reproduce the bug with the password generator:

  1. Open the password generator
  2. Generate a password which ends or starts with a number or a special character
  3. Copy the generated password and compare it with the displayed password

Expected Result

The username, password, URL, and custom field of a vault item should appear exactly as they were typed.

The generated password that is displayed in the Password Generator should be identical to the copied password.

Actual Result

The details of the vault item appear as follows:

  • Username: user_
  • Password: *pass
  • URL: /https://bitwarden.com
  • Custom field (text): #@custom-text$

Notice that the special characters at the start and end of each field have been reversed (same thing happens with the Password Generator).

Additional Context

The bug most likely happens because the direction of text fields automatically follows the direction of the layout (RTL).

This behavior is unwanted because it causes confusion and error when copying a displayed field visually.

Most websites do not allow passwords or usernames to contain RTL scripts, and when such characters appear in a URL, they must be (percent) encoded. So there is no benefit to apply an RTL direction to such fields.

Note that the RTL text direction is desired in the notes field of a login vault item as well as in a secure note and in the various fields of an identity vault item, because they are more likely to be written from right-to-left. So the current behavior should remain unchanged for them.

Lastly, it should be noted that the password and text fields of a Send are also affected.

UPDATE: It seems that this issue is present in the master password input field as well!

Build Version

2025.1.2

Environment Details

  • OS Version: Android 14

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
@codokie codokie added the bug label Feb 20, 2025
@bitwarden-bot
Copy link

Thank you for your report! We've added this to our internal board for review.
ID: PM-18467

@codokie
Copy link
Author

codokie commented Apr 6, 2025

Please take a look at my proposed fix for the same problem in KeePassDX: Kunzisoft/KeePassDX@750e1b6

I have not looked into the Bitwarden codebase but I believe it should be easy to adapt such a change.

I would have opened a PR myself if it was possible to set up Bitwarden in Android Studio without setting up a server as well.

@SaintPatrck
Copy link
Contributor

Hi @codokie,
Are you receiving a specific error that is preventing you from opening and running the project from Android Studio? I ask because setting up a server is not required to run Bitwarden from Android Studio. As stated in the Setup section, the only requirement is having a GitHub token with package:read access defined in user.properties so that the Bitwarden SDK can be downloaded from GitHub's Maven Repo.

@codokie
Copy link
Author

codokie commented Apr 8, 2025

@SaintPatrck There is no error but it asks me to log in to a Bitwarden account.

Is there a way to use the debug app without doing so? If not, I guess I could create a dummy account just for testing purposes..

Edit: There would also be a need to test the text direction of the OTP codes which is a Premium feature..

@SaintPatrck
Copy link
Contributor

No, an account is required. You can log into your regular account or create a new one if you're not comfortable using your regular account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants