RFR: 8306447: Adding an element to a long existing list may cause the first visible element to jump

Marius Hanl mhanl at openjdk.org
Wed Apr 19 16:35:55 UTC 2023


On Wed, 19 Apr 2023 13:13:45 GMT, Johan Vos <jvos at openjdk.org> wrote:

> Calculate position of first visible element before propagating changes.
> Make sure to restore the position of said element after the changes are done.
> 
> Fix JDK-8306447

modules/javafx.controls/src/main/java/javafx/scene/control/skin/VirtualFlow.java line 858:

> 856: 
> 857:         @Override protected void invalidated() {
> 858:             int oldIndex = computeCurrentIndex();

I wonder if we can cache the old index somewhere since the _compute..._ methods can take some time on big tables.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1099#discussion_r1171592530


More information about the openjfx-dev mailing list