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

Regression: eventFilter on TextField in editable ComboBox doesn't receive ENTER



      To reproduce, compile and run the example below
      - press enter in the combo's textField
      - expected: log message printed
      - actual: nothing printed

      This is a regression of JDK-8145515, probably (don't have an intermediate version handy to verify) introduced by fixing JDK-8149622.

      Both fixes reside in ComboBoxPopupControl.handleKeyEvent. The fixing idea (afaiu) of the former was to fire a not consumed enter onto the textField (and prevent back-fireing by a custom flag on the textField properties). After fixing the latter, an uncomsumed enter is only fired for eventType keyReleased.

      The example:

      public class TextFieldInComboBug extends Application {

          private Parent createContent() {
              ComboBox<String> comboBox = new ComboBox<>();
              comboBox.getItems().addAll("something to choose", "another thingy to have");
              // regression of https://bugs.openjdk.java.net/browse/JDK-8145515
              // ENTER not received
              comboBox.getEditor().addEventFilter(KeyEvent.KEY_PRESSED, e -> {
                  LOG.info("got key in editor filter: " + e);

              VBox content = new VBox(10, comboBox);
              return content;

          public void start(Stage stage) throws Exception {
              stage.setScene(new Scene(createContent()));

          public static void main(String[] args) {

          private static final Logger LOG = Logger



          Issue Links



              • Assignee:
                aghaisas Ajit Ghaisas
                fastegal Jeanette Winzenburg
              • Votes:
                0 Vote for this issue
                1 Start watching this issue


                • Created: