Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8296266

TextArea: Navigation breaks with RTL text

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • tbd
    • jfx20
    • javafx
    • None

      It looks like left-arrow navigation breaks if the text contains RTL characters.

       * To reproduce:
       * place the cursor on a line following "Arabic: العربية"
       * and try going back with arrow-left key.

      Alternatively, simply inserting the following string into a TextArea results in left arrow / right arrow keys inoperable, even when the right font is selected:
      "Arabic: \u0627\u0644\u0639\u0631\u0628\u064a\u0629";

      (use MonkeyTester TextArea page, set Al Bayan Bold font on Mac, for example)

      Fails on Mac Ventura 13.1 and Windows 11

      edit 2023/10/11:
      1. The navigation also fails with jsk 1.8.0_131 (windows 10) but slightly differently. the cursor does move across LTR text, then fails somewhere in the middle of RTL (Hebrew) text. Try this text string: Hebrew עִבְֿרִית, Ivrit
      "Hebrew \u05e2\u05b4\u05d1\u05b0\u05bf\u05e8\u05b4\u05d9\u05ea, Ivrit"

      2. Looks like there exist a wide variety of behaviors with respect to bidi text, summarized in this gist:
      https://gist.github.com/andy-goryachev-oracle/4802f9380fb03ec2be7ac36bd98a2059
      The question is - how FX should work, considering that it seems to be navigating differently than swing in jfx8, and it might work differently (though we never know because it never did) with jfx17+?

      edit 2024/11/20:
      The issue also appears when the text control (TextField, TextArea, PasswordField) is set to NodeOrientation.RIGHT_TO_LEFT, even without bidi text.

            angorya Andy Goryachev
            angorya Andy Goryachev
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: