< prev index next >

modules/controls/src/main/java/javafx/scene/control/skin/ComboBoxPopupControl.java

Print this page
rev 9269 : [mq]: 8136838

@@ -32,11 +32,10 @@
 import com.sun.javafx.scene.traversal.Direction;
 import com.sun.javafx.scene.traversal.ParentTraversalEngine;
 import com.sun.javafx.scene.traversal.TraversalContext;
 import javafx.beans.InvalidationListener;
 import javafx.beans.value.ObservableValue;
-import javafx.css.PseudoClass;
 import javafx.css.Styleable;
 import javafx.event.EventHandler;
 import javafx.geometry.Bounds;
 import javafx.geometry.HPos;
 import javafx.geometry.Point2D;

@@ -135,10 +134,15 @@
         // move fake focus in to the textfield if the comboBox is editable
         comboBoxBase.focusedProperty().addListener((ov, t, hasFocus) -> {
             if (getEditor() != null) {
                 // Fix for the regression noted in a comment in RT-29885.
                 ((FakeFocusTextField)textField).setFakeFocus(hasFocus);
+
+                // JDK-8120120 (aka RT-21454) and JDK-8136838
+                if (!hasFocus) {
+                    setTextFromTextFieldIntoComboBoxValue();
+                }
             }
         });
 
         comboBoxBase.addEventFilter(KeyEvent.ANY, ke -> {
             if (textField == null || getEditor() == null) {

@@ -579,8 +583,6 @@
      *                                                                         *
      * Stylesheet Handling                                                     *
      *                                                                         *
      **************************************************************************/
 
-    private static PseudoClass CONTAINS_FOCUS_PSEUDOCLASS_STATE = PseudoClass.getPseudoClass("contains-focus");
-
 }
< prev index next >