changeset 1259:85d4575070f8

Fixed RT-22112: ComboBox : regression with editor selection
author leifs
date Mon, 11 Jun 2012 10:45:24 -0700
parents 8bc39da3d194
children 52cf4be61cfe
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Mon Jun 11 10:00:33 2012 -0700
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TextFieldSkin.java	Mon Jun 11 10:45:24 2012 -0700
@@ -253,7 +253,12 @@
             }
         });
         textNode.fillProperty().bind(textFill);
-        textNode.impl_selectionFillProperty().bind(highlightTextFill);
+        textNode.impl_selectionFillProperty().bind(new ObjectBinding<Paint>() {
+            { bind(highlightTextFill, textFill, textField.focusedProperty()); }
+            @Override protected Paint computeValue() {
+                return textField.isFocused() ? highlightTextFill.get() : textFill.get();
+            }
+        });
         // updated by listener on caretPosition to ensure order
         textNode.impl_caretPositionProperty().set(textField.getCaretPosition());
         textField.selectionProperty().addListener(new InvalidationListener() {