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

ComboBox: incorrect behavior when clicking the arrow


    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: javafx
    • Environment:



      This happens if the editable property is dynamically set to true after the skin is created. The example below compares a combo which is editable from start with a combo that has its editable set via a button.

      Run and
      - open the popup of the initially editable combo
      - click on the arrow: popup is hidden - expected behavior
      - click on the button to make the other combo editable
      - open popup of other clickup and click on its arrow
      - expected: same as first combo, that is hide popup
      - actual: popup hidden and shown again

      Technical reason is ComboBoxBaseSkin: it registers the mouse handler only if the combo is editable at that time of skin instantiation. Aside: fixing this will make a complete hack around JDK-8150951 even more hacky ;-)

      public class ComboEditableArrowHandler extends Application {

          private Parent getContent() {
              ComboBox box = new ComboBox(FXCollections.observableArrayList("one", "two", "three"));
              box.setValue("initial editable");
              ComboBox core = new ComboBox(FXCollections.observableArrayList("one", "two", "three"));
              core.setValue("dynamic editable");
              Button toggle = new Button("toggle editable");
              toggle.setOnAction(e -> {
              return new VBox(10, box, core, toggle);
          public void start(Stage primaryStage) throws Exception {
              primaryStage.setScene(new Scene(getContent()));

          public static void main(String[] args) {




            • Assignee:
              jgiles Jonathan Giles
              fastegal Jeanette Winzenburg
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created: