TextField/TextArea: text is not scrolled to show the selection range

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 9
    • Component/s: javafx
    • None
    • Environment:

      b129, Win7

      Text is not scrolled to show the selection range.

      Sample to reproduce:

      import javafx.application.Application;
      import javafx.event.ActionEvent;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.TextField;
      import javafx.scene.layout.Pane;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class App extends Application {

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

          @Override
          public void start(Stage stage) throws Exception {
              TextField control = new TextField("one two three four five");
              control.setPrefWidth(80);
              Button button = new Button("Button");
              button.setOnAction(new EventHandler<ActionEvent>() {
                  @Override
                  public void handle(ActionEvent t) {
                      control.requestFocus();
                      control.selectRange(control.getText().length(), control.getText().length());
                      control.selectRange(5, 11);
                  }
              });
              Scene scene = new Scene(new VBox(button, new Pane(control)), 100, 100);
              stage.setScene(scene);
              stage.show();
          }
      }

            Assignee:
            Unassigned
            Reporter:
            Oleg Barbashov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: