title: JavaFX Combobox doesn't change to clicked value from the first and second click
body: <p>I have a <code>ComboBox</code> named <code>verreGcombo</code> that gets populated with items of type <code>Verre</code>, the problem I face is that when I want to select a value from it, it always fail to change its value on the first and the second click and sometimes more, so I always have to use arrows to navigate and select items or click more than three times to select an item. this issue isn't present with other ComboBoxes ( which items number doesn't exceed 5), here is my code : </p>
  
  <pre><code>List&lt;Verre&gt; ListeVerres = em.createQuery("SELECT v FROM Verre v").getResultList();
          ObservableList&lt;Verre&gt; dataVerres = FXCollections.observableList(ListeVerres);
          ListeVerres.add(null);
  
          verreGcombo.setCellFactory((comboBox) -&gt; {
              return new ListCell&lt;Verre&gt;() {
                  @Override
                  protected void updateItem(Verre item, boolean empty) {
                      super.updateItem(item, empty);
  
                      if (item == null || empty) {
                          setText("Choisir");
                          verreGcombo.getSelectionModel().clearSelection();
                          //verreGcombo.getItems().clear();
                      } else {
                          setText(item.getMatiere() + " " + item.getType());
                      }
                  }
              };
          });
  
  // Define rendering of selected value shown in ComboBox.
          verreGcombo.setConverter(new StringConverter&lt;Verre&gt;() {
              @Override
              public String toString(Verre verre) {
                  if (verre == null) {
                      return "Choisir";
                  } else {
                      return verre.getMatiere() + " " + verre.getType();
                  }
              }
  
              @Override
              public Verre fromString(String articleString) {
                  return null; // No conversion fromString needed.
              }
          });
  
          verreGcombo.setOnAction((e) -&gt; {
  
              Verre verreG = verreGcombo.getSelectionModel().getSelectedItem();
  
              if (verreG != null) {
  
                  verreGprixT.setText(setFloat(verreG.getArticle().getPrixVenteTTC()));
                  verreGPrixHR = verreG.getArticle().getPrixVenteTTC();
                  verreGRemise = (verreGPrixHR * verreG.getArticle().getRemise()) / 100;
                  verreGPrix = verreGPrixHR - verreGRemise;
                  indice.setText(setFloat(verreG.getIndice()));
                  verreGfield.setText(verreG.getMatiere() + " " + verreG.getType());
  
              } else {
                  verreGprixT.setText(setFloat(0));
                  verreGPrixHR = 0;
                  verreGRemise = 0;
                  verreGPrix = 0;
                  indice.setText(setFloat(0));
                  verreGfield.setText("");
  
              }
          });
  
          verreGcombo.setItems(dataVerres);
  </code></pre>