JDK-8242616 : Regression: RTL - TextField Cursor Movement Via Keyboard
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: jfx14
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_10
  • CPU: x86_64
  • Submitted: 2020-04-13
  • Updated: 2024-11-04
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.
Other
tbdUnresolved
Related Reports
Blocks :  
Relates :  
Description
ADDITIONAL SYSTEM INFORMATION :
OpenJFX 14

A DESCRIPTION OF THE PROBLEM :
When TextField has right-to-left orientation and it has keyboard focus, pressing left-arrow and right-arrow keys on keyboard does not move the cursor within the contents of the TextField. Pressing up-arrow moves cursor to start of text. Pressing down-arrow moves cursor to end of text. Pressing left-arrow or right-arrow keys does not move cursor at all.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a JavaFX application. Create a TextField control. Add text to the TextField. Set the TextField orientation to right-to-left. Add the TextField to a Scene. Give the TextField keyboard focus. Press left-arrow or right-arrow keys on keyboard. Cursor does not move.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Pressing left-arrow key should move cursor by one character. Similarly when pressing right-arrow key. This is the behavior when the orientation of the TextField is left-to-right.
ACTUAL -
Cursor does not move when pressing left-arrow key or right-arrow key.

---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.geometry.NodeOrientation;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.TextField;
import javafx.stage.Stage;

public class FxTxtFld extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        TextField txtFld = new TextField("sampler");
        txtFld.setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT);
        Group root = new Group(txtFld);
        Scene scene = new Scene(root);
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Do not set TextField orientation to right-to-left.

FREQUENCY : always



Comments
Since the navigation and behavior at bidi text boundary is not clear stopping the progress on this bug. PR moved to draft stage
21-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/1222 Date: 2023-08-25 11:41:22 +0000
25-08-2023

This issue is similar to JDK-8296266. Please take a look at https://github.com/openjdk/jfx/pull/1220/files
23-08-2023

also note that shift/left/right does extend the selection as expected, just - into the opposite direction ;)
14-04-2020

working in fx 8 (rather oldish version 8u152), so marked as regression and uppened priority
14-04-2020