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

[SuperEditor][SuperTextField] Improve RTL support (Resolves #2472) #2518

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

angelosilvestre
Copy link
Collaborator

[SuperEditor][SuperTextField] Improve RTL support. Resolves #2472

We have some issues in RTL support:

  • When typing in a SuperEditor with a RTL language, the caret always stays at the right side.
  • When typing in a SuperTextField with a RTL language, the caret always stays at the right side and the text is left-aligned.

For SuperEditor, we have code to infer the text direction from the text itself, but we weren't passing the text direction down the TextComponent, and we were also not passing it to LayoutAwareRichText. As the result, the caret position is computed as if we are in LTR.

For SuperTextField, we weren't inferring the text direction from the text.

This PR makes the following changes:

  • Allows passing the text direction to LayoutAwareRichText.
  • Makes the SuperTextField's textAlign nullable, to choose the alignment based on the text direction, if the app doesn't enforce a text alignment.
  • Applies a directionality to list items and tasks, to place the checkbox and list indicators in the right side when in RTL mode.

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.

Cursor Does Not Stay on the Left for RTL Input in SuperTextField
1 participant