-
Notifications
You must be signed in to change notification settings - Fork 13k
fix: Fixed UI anomalies faced when using RTL languages #32749
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
Conversation
|
|
In the recent commits, changed the logic to fix the problem of left aligning text due to my previous logic. |
|
I would really appreciate a code review :) |
|
Hi there, thanks for the contribution! 🚀 💯 Closing this PR because it's stale now and it was already fixed here: #33796 Questions? Help needed? Feature Requests?
|
Problems Addressed and Context:
For a long time now RTL language users have reported seeing various anomalies in the UI starting from the home page. I investigated the issue and found that the major culprit for a lot of these problems was CustomScrollable component. Which for RTL users shows a default scrollbar of browser as well as our own implemented custom scrollbar too. This results in RTL users seeing two scrollbars a lot of place where there should only have been one scrollbar. This was first reported in August 2023.
Proposed changes (including videos or screenshots)
Before:
Before.mp4
After:
After2.mp4
A lot of languages gets affected from it and even the basic Home Page suffers. Additionally It has been constantly reported by the users.
Technical Changes
Dynamically adding styles to remove the default scrollbar as we have already implemented the custom scrollbar. Letting default scrollbar visible results in two visible scrollbar for RTL languages.
Used a useEffect hook to add the style on Mount and also cleaned it up to avoid potential issues.
Issue(s)
Fixes #30095
Fixes #30564
Steps to test or reproduce
Change the client's language to any RTL language like Persian.
Double scrollbars will be seen in the places where only single scrollbar is expected.
Further comments
I was researching about this and found that there is also a property of document object, document.dir which gives us whether the text is going LTR or RTL, I tried to implement that too, but couldn't.
Furthermore as this is my first PR at RocketChat I would love to hear any reviews.
Thanks.