se-edu / guides

Style guides and tutorials for SE student projects
MIT License
7 stars 26 forks source link

Unable to scroll ScrollPane when hovered #12

Open flexibo opened 4 months ago

flexibo commented 4 months ago

The current version does not allow scrolling if the ScrollPane is unselected unless the scrollbar is clicked. Note that the code is referenced from part 4 of the guide.

Untitled video - Made with Clipchamp (1)

Using ChatGPT, I find that this fix works by changing the way we automatically scroll to the bottom, but I do not fully understand why the initial version will cause the above issue.

MainWindow.java:

    @FXML
    public void initialize() {
        //scrollPane.vvalueProperty().bind(dialogContainer.heightProperty());
        dialogContainer.heightProperty().addListener((observable, oldValue, newValue) -> scrollPane.setVvalue(1.0));
    }
damithc commented 4 months ago

@flexibo Thanks for this suggestion. Will look into it in due course.