Skip to content

JavaFX 17 breaks scrollbar behaviours in VirtualizedScrollPane #97

@fthevenet

Description

@fthevenet

Starting with javaFX 17-ea+11 I noticed that scrolling a StyledTextArea (from RichTextFX) no longer worked properly: when clicking the scroll bar elements, the text scrolls for the first couple of clicks and then entirely stop responding to clicks on these elements.
It does respond to using the mouse wheel of keyboard arrows however.

broken_scrolling.mp4

Since it did work with previous early access of jfx (up to 17-ea-9, actually), I did manage to pinpoint that change responsible: openjdk/jfx#454

The above PR changes the type of listener used internally by the built-in bi-directional bindings, from ChangeListeners<T> to InvalidationListeners.
This should be transparent to most if not all applications, but because Flowless relies on ReactFX, which interacts with bindings and events in a very intimate way, something was broken by that change.

I managed to workaround the issue in the VirtualizedScrollPane by replacing the affect bi-directional bindings by a couple of mirrored ChangeListeners.

I will submit a PR illustrating this workaround for your consideration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions