RT-34115: DatePicker: space is inserted into the textfield when pressing space to close the popup. diff -r 85de716883ff modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/DateCellBehavior.java --- a/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/DateCellBehavior.java Tue Nov 05 14:46:45 2013 -0800 +++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/DateCellBehavior.java Thu Nov 07 09:33:06 2013 -0800 @@ -43,6 +43,7 @@ import static javafx.scene.input.KeyCode.RIGHT; import static javafx.scene.input.KeyCode.SPACE; import static javafx.scene.input.KeyCode.UP; +import static javafx.scene.input.KeyEvent.*; /** * Behaviors for LocalDate based cells types. Simply defines methods @@ -59,8 +60,8 @@ DATE_CELL_BINDINGS.add(new KeyBinding(DOWN, "TraverseDown")); DATE_CELL_BINDINGS.add(new KeyBinding(LEFT, "TraverseLeft")); DATE_CELL_BINDINGS.add(new KeyBinding(RIGHT, "TraverseRight")); - DATE_CELL_BINDINGS.add(new KeyBinding(ENTER, "SelectDate")); - DATE_CELL_BINDINGS.add(new KeyBinding(SPACE, "SelectDate")); + DATE_CELL_BINDINGS.add(new KeyBinding(ENTER, KEY_RELEASED, "SelectDate")); + DATE_CELL_BINDINGS.add(new KeyBinding(SPACE, KEY_RELEASED, "SelectDate")); } diff -r 85de716883ff modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/DatePickerBehavior.java --- a/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/DatePickerBehavior.java Tue Nov 05 14:46:45 2013 -0800 +++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/behavior/DatePickerBehavior.java Thu Nov 07 09:33:06 2013 -0800 @@ -78,9 +78,6 @@ DATE_PICKER_BINDINGS.add(new KeyBinding(F4, KEY_RELEASED, "togglePopup")); DATE_PICKER_BINDINGS.add(new KeyBinding(UP, "togglePopup").alt()); DATE_PICKER_BINDINGS.add(new KeyBinding(DOWN, "togglePopup").alt()); - DATE_PICKER_BINDINGS.add(new KeyBinding(ESCAPE, KEY_PRESSED, CLOSE_ACTION)); - DATE_PICKER_BINDINGS.add(new KeyBinding(SPACE, KEY_PRESSED, OPEN_ACTION)); - DATE_PICKER_BINDINGS.add(new KeyBinding(ENTER, KEY_PRESSED, OPEN_ACTION)); } @Override protected void callAction(String name) { diff -r 85de716883ff modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java --- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java Tue Nov 05 14:46:45 2013 -0800 +++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/ComboBoxListViewSkin.java Thu Nov 07 09:33:06 2013 -0800 @@ -186,6 +186,7 @@ // This forwards the event down into the TextField when // the key event is actually received by the ComboBox. textField.fireEvent(ke.copyFor(textField, textField)); + ke.consume(); } } }); diff -r 85de716883ff modules/controls/src/main/java/com/sun/javafx/scene/control/skin/DatePickerSkin.java --- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/DatePickerSkin.java Tue Nov 05 14:46:45 2013 -0800 +++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/DatePickerSkin.java Thu Nov 07 09:33:06 2013 -0800 @@ -147,6 +147,7 @@ // This forwards the event down into the TextField when // the key event is actually received by the ComboBox. textField.fireEvent(ke.copyFor(textField, textField)); + ke.consume(); } } });