JDK-8191995 : Regression: DatePicker must commit on focusLost
  • Type: Bug
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 9,10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2017-11-28
  • Updated: 2021-12-08
  • Resolved: 2021-12-07
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.
Other
openjfx18Fixed
Related Reports
CSR :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
had been fixed in JDK-8136838  and broken with fixing JDK-8150946 

The technical reason is the change in ComboBoxPopupControl in the latter, which removes the code that had been added in the former:

+++ b/modules/controls/src/main/java/javafx/scene/control/skin/ComboBoxPopupControl.java	Fri Jun 17 12:47:34 2016 +1200

@@ -138,11 +138,6 @@

             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();

-                }

             }

         });

The deeper reason is the oversight to not add commit/cancel semantics to the DatePicker - had not explicitly been mentioned in JDK-8150946 ... 

Comments
Changeset: 6fd4ab61 Author: Marius Hanl <mhanl@openjdk.org> Committer: Kevin Rushforth <kcr@openjdk.org> Date: 2021-12-07 19:55:41 +0000 URL: https://git.openjdk.java.net/jfx/commit/6fd4ab6104ebaa97530ea9182466e6c1e346a4f4
07-12-2021

Just to clarify: to fix the issue, DatePicker should - get the same commit/cancel api as ComboBox - install a focusListener that calls commit in the picker itself, not re-introduce the listener in the skin (the latter would revive the JDK-8151129)
07-12-2017

Step to reproduce this bug : Run HelloDatePicker. Type some valid text followed by Tab. The new value remains in the text field, but it is not committed.
29-11-2017