-
Bug
-
Resolution: Fixed
-
P3
-
None
This is split away from JDK-8164979, for ease of bug fixing. This issue covers the following issue:
Incorrect selection while navigating between menu items. To reproduce:
- select the first menu (by mouse or keyboard);
- move the selection pointer to the second item by pushing DOWN key;
- collapse menu by ESC key or select the second item;
- select the first menu again;
- press DOWN arrow key
Third item will be selected. It seems that the the last selection state is restored.
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();
}
}
Incorrect selection while navigating between menu items. To reproduce:
- select the first menu (by mouse or keyboard);
- move the selection pointer to the second item by pushing DOWN key;
- collapse menu by ESC key or select the second item;
- select the first menu again;
- press DOWN arrow key
Third item will be selected. It seems that the the last selection state is restored.
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();
}
}