On Mon, 21 Sep 2026 15:48:15 GMT, Michael Strauß <[email protected]> wrote:

> `VirtualFlow` stores the scroll location in two values:
> - `position`: a value from `0` to `1`
> - `absoluteOffset`: the scroll distance in pixels
> 
> These two values can become inconsistent in the following scenario, which is 
> exercised by the test:
> 
> Given three cells, each 25 pixels high, in a viewport that is 75 pixels high 
> so all cells fit. Both scroll values must therefore be zero.
> The test asks the VirtualFlow to scroll to the last cell, setting 
> `absoluteOffset` to `50`. The VirtualFlow sets `position` to zero because all 
> cells still fit.
> 
> However, `position` was already zero. Setting it to zero again does not 
> trigger the code that updates `absoluteOffset`, and the offset incorrectly 
> stays at `50`. The patch is quite easy: it sets `absoluteOffset` to zero when 
> all cells fit.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

This pull request has now been integrated.

Changeset: 7f321a70
Author:    Michael Strauß <[email protected]>
URL:       
https://git.openjdk.org/jfx/commit/7f321a7015e001a2822b5b10e27701503acf0828
Stats:     36 lines in 2 files changed: 31 ins; 0 del; 5 mod

8392756: VirtualFlow: stale absoluteOffset permanently hides rows in a 
TableView with a horizontal scrollbar

Reviewed-by: angorya, mhanl

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

PR: https://git.openjdk.org/jfx/pull/2317

Reply via email to