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

Regression: RTL - TextField Cursor Movement Via Keyboard

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      windows_10

      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


        Attachments

          Activity

            People

            • Assignee:
              aghaisas Ajit Ghaisas
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: