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

[New Arch] RTL to LTR of vise versa Layout Direction Change Requires App Termination to Apply #48311

Open
1 task done
a-eid opened this issue Dec 17, 2024 · 3 comments
Open
1 task done
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.

Comments

@a-eid
Copy link

a-eid commented Dec 17, 2024

Description

When toggling RTL layout direction dynamically using I18nManager.forceRTL(true) or switching between languages in the system settings, the Yoga layout engine does not immediately apply the updated layout direction. Even with a forced app restart (e.g., via RNRestart), the changes are not respected.

A complete termination and relaunch of the app is required for the changes to take effect. This creates significant friction for users and developers aiming to support dynamic language and layout changes for right-to-left (RTL) languages.

Report

Issues and Steps to Reproduce

Toggle RTL programmatically:

I18nManager.forceRTL(true);
I18nManager.allowRTL(true);
RNRestart.Restart();

Alternatively, change the device language to an RTL language (e.g., Arabic ) in the app settings. ( assuming you added such functionality )

Observe that the layout direction does not change immediately.

Terminate the app completely and relaunch it manually. Only then does the layout respect the RTL direction.

Expected Behavior

the layout direction should change.

Actual Behavior

the layout direction does not change.

related react-native Issue

@a-eid a-eid changed the title RTL to LTR of vise versa Layout Direction Requires App Termination to Apply RTL to LTR of vise versa Layout Direction Change Requires App Termination to Apply Dec 17, 2024
@NickGerleman NickGerleman transferred this issue from facebook/yoga Dec 17, 2024
@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Dec 17, 2024
@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@NickGerleman
Copy link
Contributor

Moved to RN repo since this is implementation issue with RN iOS New arch instead of Yoga layer.

@a-eid
Copy link
Author

a-eid commented Dec 17, 2024

@NickGerleman unfortunately the RN issue is locked and I don't think there is any plans to fix this issue any time soon.
it's blocking many RTL apps from migrating to the new arch.

I thought there might be an issue with how yoga handles RTL & LTR with the new arch..

reproducer

@serhii-yalla

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Dec 17, 2024
@a-eid a-eid changed the title RTL to LTR of vise versa Layout Direction Change Requires App Termination to Apply [New Arch] RTL to LTR of vise versa Layout Direction Change Requires App Termination to Apply Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.
Projects
None yet
Development

No branches or pull requests

3 participants