changeset 206:87227803da34

RT-18529: [ComboBox] Bottom part of comboBox is not responding on clicking.
author jgiles
date Thu, 29 Dec 2011 16:57:15 +1000
parents 4499bb1a2e44
children d3a30f9b38c3
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxPopupControl.java
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxPopupControl.java	Thu Dec 29 16:47:13 2011 +1000
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxPopupControl.java	Thu Dec 29 16:57:15 2011 +1000
@@ -36,6 +36,7 @@
 import javafx.scene.control.PopupControl;
 import javafx.scene.control.Skin;
 import javafx.scene.control.Skinnable;
+import javafx.scene.input.MouseEvent;
 
 public abstract class ComboBoxPopupControl<T> extends ComboBoxBaseSkin<T> {
     
@@ -101,5 +102,14 @@
                 getBehavior().onAutoHide();
             }
         });
+        popup.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
+            @Override public void handle(MouseEvent t) {
+                // RT-18529: We listen to mouse input that is received by the popup
+                // but that is not consumed, and assume that this is due to the mouse
+                // clicking outside of the node, but in areas such as the 
+                // dropshadow.
+                getBehavior().onAutoHide();
+            }
+        });
     }
 }