JDK-8094476 : [ComboBox, DatePicker] DatePicker and editable ComboBox consume ESC key event, also when no popup is shown
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8u20
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2014-09-12
  • Updated: 2015-06-12
  • Resolved: 2015-05-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8u60Resolved
Related Reports
Duplicate :  
Description
I'm using a DatePicker control inside a Dialog window (created with the ControlsFX library). The dialog needs to close when the user presses the ESC button. It works perfectly as long as the DatePicker control does not have the focus. When other textfields, buttons etc. have the focus, the dialog closes perfectly.

Here's the problem: the DatePicker consumes the ESC key event when the calendar popup of the DatePicker is shown. It closes the calendar in this case, that's OK. 
But it must not consume the ESC key event when no calendar popup is shown, the event needs to be passed to the next responsible consumer. Then the dialog would close properly.
Comments
Closing as duplicate of RT-34620, which also covers the ENTER and F10 keys.
11-05-2015

ComboBox and DatePicker will forward key events to the textfield. When events like Escape and Enter originate from the textfield and bubble up, they will be consumed to avoid them being forwarded back to the textfield. This is wrong. These events should neither be consumed nor forwarded, but should be allowed to continue to bubble up the scene graph.
16-03-2015

I've retested this bug with the DatePicker in JavaFX 8u40, it has been almost fixed. When the dialog contains a DatePicker and the DatePicker contains the focus, then the user can close the dialog by pressing ESC, this key event is not consumed by the DatePicker anymore. However: when the user has been opened the monthy calendar view of the DatePicker, then this calendar will be closed when pressing the ESC key - this is OK. But when the user presses ESC again, the event gets lost or is consumed. The dialog does not closes, no matter how many times ESC has been pressed.
12-03-2015