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

Wrong cursor position When Mixing RTL and LTR Text #302

Open
bcmehdi8 opened this issue Mar 27, 2024 · 2 comments
Open

Wrong cursor position When Mixing RTL and LTR Text #302

bcmehdi8 opened this issue Mar 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@bcmehdi8
Copy link

bcmehdi8 commented Mar 27, 2024

I notice an issue of wrong cursor positioning when writing arabic (RTL) with any other LTR language, the cursor issue is related only to LTR text, the cursor should be in the beginning of the LTR word when typing LTR text rather than the end of the word

This issue appear while Direction is set to RTL and TextAlignment set to Right

Here's the issue on Latest fleather demo

fleather-cursor.mov

Here's an example of how the cursor should behave around LTR words

correct-arabic-english-text.mp4

Environment

  • Android 14
  • Flutter version 3.19.4
  • Fleather version 1.14.2

Thanks for this Amazing package!

@Amir-P
Copy link
Member

Amir-P commented Apr 11, 2024

Thanks for creating the issues! I have to say I'm not text editing expert, but there seems to be no standard for it and it's rather a design choice in different platforms and rich text editing softwares. Here are some examples:

Flutter's TextField on iOS:
Screenshot 2024-04-11 at 16 47 42

Flutter's TextField on Android:
Screenshot 2024-04-11 at 16 49 17

Flutter's TextField on Web (macOS):
Screenshot 2024-04-11 at 16 57 12

Microsoft Word on macOS:
Screenshot 2024-04-11 at 16 35 38

Google Docs (Web):
Screenshot 2024-04-11 at 16 38 49

Apple Notes on macOS:
Screenshot 2024-04-11 at 16 39 47

It seems like our editor behaves the same as Flutter's TextField but that doesn't necessarily mean it's the correct behavior and it has to be this way. Both way of painting cursor have advantages and disadvantages. When cursor is painted at the end of line (leftmost) when user types an RTL character it would be inserted where cursor was but if types LTR it will be inserted in the end of LTR text part and not where the cursor was.

Do you have any thoughts or proposal for this? @bcmehdi8

@Amir-P Amir-P added the enhancement New feature or request label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants