Skip to content

Commit 3f50851

Browse files
committed
Fix trackpad scrolling by replacing scroll pane bind with height listener
1 parent f21c0f7 commit 3f50851

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/flora/ui/MainWindow.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import javafx.scene.control.ScrollPane;
88
import javafx.scene.control.TextField;
99
import javafx.scene.image.Image;
10+
import javafx.scene.input.MouseEvent;
1011
import javafx.scene.layout.AnchorPane;
1112
import javafx.scene.layout.VBox;
1213
import javafx.util.Duration;
@@ -31,7 +32,8 @@ public class MainWindow extends AnchorPane {
3132
*/
3233
@FXML
3334
public void initialize() {
34-
scrollPane.vvalueProperty().bind(dialogContainer.heightProperty());
35+
dialogContainer.heightProperty().addListener((obs, oldVal, newVal) -> scrollPane.setVvalue(1.0));
36+
scrollPane.addEventFilter(MouseEvent.MOUSE_MOVED, event -> scrollPane.requestFocus());
3537
}
3638

3739
/**

0 commit comments

Comments
 (0)