On Tue, 31 Oct 2023 19:20:48 GMT, brunesto <d...@openjdk.org> wrote:

> The fix prevents the DatePicker from losing focus if the date is not parsable.

modules/javafx.controls/src/main/java/javafx/scene/control/DatePicker.java line 
159:

> 157:      * This is to address https://bugs.openjdk.org/browse/JDK-8303478
> 158:      */
> 159:     protected void commitValueOnFocusLost(){

The `protected` modifier makes this method public API, which would most likely 
require a CSR to be approved. Since there doesn't seem to be a reason why this 
method should be public, I suggest making it private instead.

modules/javafx.controls/src/main/java/javafx/scene/control/DatePicker.java line 
163:

> 161:             commitValue();
> 162:         } catch (DateTimeParseException dtpe) {
> 163:             this.requestFocus();

I'm not sure whether moving focus to the control is a good idea, because this 
effectively captures focus and forces me to enter a valid date before I can do 
anything else. Why not just restore the previous value instead?

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1274#discussion_r1378108562
PR Review Comment: https://git.openjdk.org/jfx/pull/1274#discussion_r1378110040

Reply via email to