JDK-8119769 : TextField/TextArea, caret movement problem for mixed text.
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-05-31
  • Updated: 2015-06-17
  • Resolved: 2013-09-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Relates :  
Description
Tested with 8.0 b91. Create some TextField/TextArea with mixed text (arabic + other characters), check the caret movement when pressing left/right/home/end keys.
There is a couple of issue:
1. For symbol + arabic, like  *#@  ��������  ,    in "*#@", when pressing right arrow key, caret move from right to left and vice versa.
2. For arabic + hindi, like   �������� ���������������  , at the beginning of hindi, when pressing right arrow key, caret doesn't move.

Attached a test program.
Comments
Changeset: http://hg.openjdk.java.net/openjfx/8/controls/rt/rev/000296470ed2
11-09-2013

The cursor movement logic depends on using visual hit testing when the content is mixed bidi. In the first example, there are only neutral and rtl characters, so the Bidi class was reporting not mixed, but all rtl, even though the neutral characters are (correctly) rendered ltr. The following patch seems to fix the problem. The second example does not seem to be reproducible anymore. Please review. diff -r 5c3ec77e5d2a modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java --- a/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java Thu Sep 05 17:02:27 2013 -0400 +++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/TextInputControlBehavior.java Fri Sep 06 12:45:54 2013 -0700 @@ -269,8 +269,8 @@ if (bidi == null) { bidi = new Bidi(textInputControl.getText(), (textInputControl.getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT) - ? Bidi.DIRECTION_DEFAULT_RIGHT_TO_LEFT - : Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT); + ? Bidi.DIRECTION_RIGHT_TO_LEFT + : Bidi.DIRECTION_LEFT_TO_RIGHT); } return bidi; }
06-09-2013