First menu item is selected if the drop down menu is expanded first time. To reproduce:
- expand drop down menu using mouse
First menu item will be selected unexpectedly. Note that there is no selection at the next attempt.
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 {
SplitMenuButton control = new SplitMenuButton();
control.setText("Split Button");
for (int i = 0; i < 5; i++) {
control.getItems().add(new MenuItem("Item " + String.valueOf(i + 1)));
}
Scene scene = new Scene(new HBox(control));
stage.setScene(scene);
stage.show();
}
}
- expand drop down menu using mouse
First menu item will be selected unexpectedly. Note that there is no selection at the next attempt.
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 {
SplitMenuButton control = new SplitMenuButton();
control.setText("Split Button");
for (int i = 0; i < 5; i++) {
control.getItems().add(new MenuItem("Item " + String.valueOf(i + 1)));
}
Scene scene = new Scene(new HBox(control));
stage.setScene(scene);
stage.show();
}
}