RichTextFX icon indicating copy to clipboard operation
RichTextFX copied to clipboard

VirtualizedScrollPane with StyleClassedTextArea does not scroll to bottom with dragging scrollbar

Open r-sop opened this issue 2 years ago • 2 comments

Expected Behavior

Dragging the Scrollbar to the bottom scrolls the text inside the StyleClassedTextArea to the last line.

Actual Behavior

This works when using the mouse wheel: scroll_with_wheel

But not when dragging the scrollbar: scroll_with_bar_drag

Environment info:

  • RichTextFX Version: 0.10.9
  • flowless Version: 0.6.9
  • Operating System: Windows 10
  • Java version: 11.0.15
  • FX version: 18

Current Workarounds

Extend the Text by adding a new line at the end.

r-sop avatar May 24 '22 08:05 r-sop

Thanks for reporting, can you please provide demo code as I haven't been able to reproduce my side.

Jugen avatar May 24 '22 09:05 Jugen

Thanks for the fast reply.

Will try. In a first attempt with a minimal exmaple (without css) I also cannot reproduce it..

r-sop avatar May 25 '22 06:05 r-sop

Finaly had time to reproduce it with a minimal example:

<?xml version="1.0" encoding="UTF-8"?>

<?import org.fxmisc.flowless.VirtualizedScrollPane?>
<?import org.fxmisc.richtext.StyleClassedTextArea?>
<?import javafx.scene.layout.BorderPane?>
<BorderPane xmlns="http://javafx.com/javafx/" xmlns:fx="http://javafx.com/fxml" fx:controller="com.example.demo.HelloController">
    <center>
        <VirtualizedScrollPane>
            <content>
                <StyleClassedTextArea fx:id="area" style="-fx-padding: 0.5em;"/>
            </content>
        </VirtualizedScrollPane>
    </center>
</BorderPane>

Complete Source: main.zip

So the padding seems to be the problem.

r-sop avatar Aug 24 '22 06:08 r-sop

@r-sop Thanks for the test case, have submitted a PR to Flowless to fix.

Jugen avatar Aug 30 '22 12:08 Jugen