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

Editable TableView loses focus after commit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • jfx23
    • jfx22
    • javafx
    • None
    • b12

      When entering edit mode on a cell of an editable TableView, the TextField control added to the cell gains the focus, and the table loses it (expected).

      If user presses ESCAPE, the edit mode gets cancelled, and the TableView regains the focus (expected).

      However, if the user presses ENTER, the edit gets committed, and the TableView loses the focus (unexpected).

      The following test reproduces the issue. The tableView has a green border if it is focused, red otherwise.
      Steps:
      - Start the test, the textField has the focus (tableView border red)
      - Click on a cell of the second column. The row gets selected, tableView gets focused, border green.
      - Click again to start editing the cell. The inner textField gains the focus, tableView loses it, border red (see edit cell.png)
      - Press ESCAPE, tableView gains focus again, border green (see after ESC.png).
      - Click again to start editing the cell. The inner textField gains the focus, tableView loses it, border red.
      - Press ENTER, outer textField gains focus again and tableView loses it, border red (see after Enter.png).


        1. after Enter.png
          after Enter.png
          203 kB
        2. after ESC.png
          after ESC.png
          204 kB
        3. edit cell.png
          edit cell.png
          205 kB
        4. FocusCommitTest-1.java
          2 kB

            jpereda Jose Pereda
            jpereda Jose Pereda
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: