lukasbach / react-complex-tree

Unopinionated Accessible Tree Component with Multi-Select and Drag-And-Drop
https://rct.lukasbach.com
MIT License
893 stars 69 forks source link

Arrow Direction Not Changing Based on Language/Orientation (RTL/LTR) #369

Closed SyedMisbahUrRehman closed 2 months ago

SyedMisbahUrRehman commented 2 months ago

I'm using React Complex Tree in my React application to display a tree view. The small arrows next to folders, which indicate expand/collapse functionality, are currently rendered in the Left-to-Right (LTR) direction.

However, when I switch the application language to Arabic (Right-to-Left, RTL) or the device orientation changes, the arrow direction doesn't automatically adjust. This creates a visual inconsistency for users.

Expected Behavior:

The arrow direction should dynamically change based on the document's direction (RTL or LTR) to maintain a consistent user experience across languages and orientations.

Looking For:

Suggestions on the most effective way to handle dynamic arrow direction changes in React Complex Tree based on language and orientation. Are there plans for built-in support for this functionality in future versions?

lukasbach commented 2 months ago

Hi, thanks for the report. Theoretically, since RCT allows library consumers to use a custom render implementation, this could be custom-implemented before. But since this wasn't possible with the default renderers, I've added a way to achieve this with the built-in renderers as of v2.4.3. See https://rct.lukasbach.com/docs/guides/accessibility#right-to-left-mode-rtl for details.

SyedMisbahUrRehman commented 2 months ago

Thanks a lot man. Much appreciated