Skip to content

Commit

Permalink
Merge pull request #4916 from Textualize/fix-scroll-page
Browse files Browse the repository at this point in the history
Fix scroll page
  • Loading branch information
willmcgugan authored Aug 22, 2024
2 parents 15c3d57 + fea0bce commit 7ea10ce
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- Fix crash when `validate_on` value isn't a set https://github.com/Textualize/textual/pull/4868
- Fix `Input.cursor_blink` having no effect on the blink cycle after mounting https://github.com/Textualize/textual/pull/4869
- Fixed scrolling by page not taking scrollbar in to account https://github.com/Textualize/textual/pull/4916

## [0.76.0]

Expand Down
8 changes: 4 additions & 4 deletions src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2647,7 +2647,7 @@ def scroll_page_up(
level: Minimum level required for the animation to take place (inclusive).
"""
self.scroll_to(
y=self.scroll_y - self.container_size.height,
y=self.scroll_y - self.scrollable_content_region.height,
animate=animate,
speed=speed,
duration=duration,
Expand Down Expand Up @@ -2680,7 +2680,7 @@ def scroll_page_down(
level: Minimum level required for the animation to take place (inclusive).
"""
self.scroll_to(
y=self.scroll_y + self.container_size.height,
y=self.scroll_y + self.scrollable_content_region.height,
animate=animate,
speed=speed,
duration=duration,
Expand Down Expand Up @@ -2715,7 +2715,7 @@ def scroll_page_left(
if speed is None and duration is None:
duration = 0.3
self.scroll_to(
x=self.scroll_x - self.container_size.width,
x=self.scroll_x - self.scrollable_content_region.width,
animate=animate,
speed=speed,
duration=duration,
Expand Down Expand Up @@ -2750,7 +2750,7 @@ def scroll_page_right(
if speed is None and duration is None:
duration = 0.3
self.scroll_to(
x=self.scroll_x + self.container_size.width,
x=self.scroll_x + self.scrollable_content_region.width,
animate=animate,
speed=speed,
duration=duration,
Expand Down
Loading

0 comments on commit 7ea10ce

Please sign in to comment.