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

TableView: removing a filter causes virtual flow position to jump far away

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • jfx19
    • javafx
    • None

      If a filter is applied over the items of a TableView, the size of items in the virtualFlow is reduced, but the position of a given selected item remains, based on the new smaller count.

      However, if the same filter is removed, all the excluded items are added back again to the table, but somehow the virtualFlow cache size is still based on the old smaller count, and the new position of the selected item is reduced by the factor of such difference.

      Let's say we have selected the last item of the table, position = 1.0. If we apply a filter that removes half of the items, when such filter gets removed, the new (wrong) position is around 0.5. If the filter removes 90% of the items, when removed, the new (wrong) position is around 0.1, and so on.

      The attached test reproduces the issue.

      - Run the application, scroll to the bottom of the table, select last item (100000).

      - Press the button once to apply the filter that removes half of the items (visible cells remain around such item as expected).

      - And press the button again to remove the filter: visible cells are around the item 50000, which is unexpected.

      This issue can be reproduced since JavaFX 19.

            jvos Johan Vos
            jpereda Jose Pereda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: