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

MenuBar: incorrect selection if mouse is hovering over expanded menu

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 9
    • javafx
    • None
    • b138, Win 7

       Incorrect selection if mouse is hovering over expanded menu:
      To reproduce:
      - expand the first menu and move the mouse to the 5-th item;
      - press RIGHT arrow button;
      - press LEFT arrow button;
      The 5-th item (or other item under the mouse if it has been moved) will be selected unexpectedly. The first item should be selected.

      Sample to check:
      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.*;
      import javafx.scene.layout.HBox;
      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 {
              MenuBar control = new MenuBar();
              for (int i = 0; i < 5; i++) {
                  Menu m = new Menu("Menu " + String.valueOf(i + 1));
                  for (int j = 0; j < 5; j++) {
                      m.getItems().add(new MenuItem("Item " + String.valueOf(j + 1)));
                  }
                  control.getMenus().add(m);
              }
              Scene scene = new Scene(new HBox(control));
              stage.setScene(scene);
              stage.show();
          }
      }

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

              Created:
              Updated: