Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8151129

Editable ComboBox value update on focus lost is too late

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 9
    • 8u74
    • javafx
    • None

      Since 8u72 an edited value is also set on focus lost. It looks like a focus listener is internally used to commit the value. However, if a user installs a focus listener to process some value action this listener is called before the value is set (through the focus listener of the control/skin). Means #getValue() fails in this case and returns the old value. The behavior is similar to releases before 8u72 when focus is lost without committing a value by pressing the Enter key.

      One would argue to observe the valueProperty instead. However, there are scenarios where it's required to commit the value before all listeners get notified - i. e. if a user requires value validation triggered on focus lost.

            jgiles Jonathan Giles
            wzberger Wolfgang Zitzelsberger
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: