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

[TabPane] Incorrect arrow key traversal through tabs after reordering

    XMLWordPrintable

Details

    • x86_64
    • windows_10

    Description

      ADDITIONAL SYSTEM INFORMATION :
      OpenJ9 13.

      A DESCRIPTION OF THE PROBLEM :
      When one drags a TabPane's last tab to the beginning of the tab area - and releases it back to its original position, the TabPane's navigation shortcuts point to wrong tabs. By keyboard shortcuts I mean CTRL + TAB & CTRL + SHIFT + TAB.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create a trivial JavaFX application with a TabPane in it, and add say five tabs. Set the DragPolicy to TabPane.TabDragPolicy.REORDER. Now, drag the very last tab to the beginning of the tab header area, and do NOT release it there, instead release it back to its original position.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I would except the keyboard shortcuts to work as they should.
      ACTUAL -
      The keyboard shortcuts are messed up, pointing to wrong tabs.

      ---------- BEGIN SOURCE ----------
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Tab;
      import javafx.scene.control.TabPane;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      public class Test extends Application {

          @Override
          public void start(Stage primaryStage) {
              TabPane tabPane = new TabPane();
              tabPane.setTabDragPolicy(TabPane.TabDragPolicy.REORDER);

              tabPane.getTabs().add(new Tab("First"));
              tabPane.getTabs().add(new Tab("Second"));
              tabPane.getTabs().add(new Tab("Third"));
              tabPane.getTabs().add(new Tab("Fourth"));
              tabPane.getTabs().add(new Tab("Fifth"));

              StackPane root = new StackPane();
              root.getChildren().add(tabPane);

              Scene scene = new Scene(root, 300, 250);

              primaryStage.setTitle("TabPane bug");
              primaryStage.setScene(scene);
              primaryStage.show();
          }
          public static void main(String[] args) {
              launch(args);
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None that I know.

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              arapte Ambarish Rapte
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: