RFR: 8277853: With Touch enabled devices scrollbar disappears and the table is scrolled to the beginning [v2]

Kevin Rushforth kcr at openjdk.java.net
Tue Jan 25 13:05:41 UTC 2022


On Tue, 25 Jan 2022 07:54:21 GMT, meghanEmbrace <duke at openjdk.java.net> wrote:

>> With a touch-enabled device, the scrollbar disappears a short while after it's used. During the layout, updateHbar() checks the hbar visibility and resets the clip, causing the user to be scrolled fully to the left when trying to access columns on the right. Using hbar.isVisible() is not feasible as there are times when the scrollbar is necessary but not visible (such as on touch-enabled devices where the scrollbar disappears when not in use, or when hidden by CSS). Hence, it is more reliable to use the variable that determines whether the hbar is necessary.
>
> meghanEmbrace has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Added requested automated test

The test looks good with one comment about replacing the null test with an assert.

modules/javafx.controls/src/test/java/test/javafx/scene/control/TableViewTest.java line 820:

> 818: 
> 819:         ScrollBar horizontalBar = VirtualFlowTestUtils.getVirtualFlowHorizontalScrollbar(table);
> 820:         if (horizontalBar != null) {

Won't `horizontalBar` always be non-null (else the test won't test anything)? I recommend removing this `if` test, and instead `assertNotNull(horizontalBar);`.

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

PR: https://git.openjdk.java.net/jfx/pull/688


More information about the openjfx-dev mailing list