Skip to content

Conversation

@akshithere
Copy link

@akshithere akshithere commented Jul 9, 2024

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

BeforeImg1

BeforeImg2

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.

@akshithere akshithere requested a review from a team as a code owner July 9, 2024 19:53
@changeset-bot
Copy link

changeset-bot bot commented Jul 9, 2024

⚠️ No Changeset found

Latest commit: dc4a1eb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@akshithere
Copy link
Author

In the recent commits, changed the logic to fix the problem of left aligning text due to my previous logic.

@akshithere
Copy link
Author

I would really appreciate a code review :)

@dougfabris
Copy link
Member

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?

  • Join our Open Server in the #support channel and feel free to raise a question
  • Join our Community Forum and search/create a post there

@dougfabris dougfabris closed this Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Horizontal scrollbars does not work in RTL languages UI problems in RTL languages

2 participants