Skip to content

Commit 59c9d25

Browse files
committed
changelog
1 parent 5b27dfa commit 59c9d25

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212
- Fixed `Link` binding to open the link https://github.com/Textualize/textual/issues/5564
1313
- Fixed issue with clear_panes breaking tabbed content https://github.com/Textualize/textual/pull/5573
1414

15+
## Changed
16+
17+
- The user can now interrupt a scroll to end by grabbing the scrollbar or scrolling in any other way. Press ++end++ or scroll to the end to restore default behavior. This is more intuitive that it may sound.
18+
1519
## [2.1.0] - 2025-02-19
1620

1721
### Fixed

src/textual/scroll_view.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ def watch_scroll_x(self, old_value: float, new_value: float) -> None:
3838
self.refresh()
3939

4040
def watch_scroll_y(self, old_value: float, new_value: float) -> None:
41-
if new_value >= self.max_scroll_y:
42-
self._user_scroll_interrupt = False
4341
if self.show_vertical_scrollbar and (old_value) != (new_value):
4442
self.vertical_scrollbar.position = new_value
4543
self.refresh()

src/textual/widget.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,8 +1700,6 @@ def watch_scroll_x(self, old_value: float, new_value: float) -> None:
17001700
self._refresh_scroll()
17011701

17021702
def watch_scroll_y(self, old_value: float, new_value: float) -> None:
1703-
if new_value >= self.max_scroll_y:
1704-
self._user_scroll_interrupt = True
17051703
self.vertical_scrollbar.position = new_value
17061704
if round(old_value) != round(new_value):
17071705
self._refresh_scroll()
@@ -2428,6 +2426,9 @@ def _animate_on_complete() -> None:
24282426
if on_complete is not None:
24292427
self.call_next(on_complete)
24302428

2429+
if y is not None and maybe_scroll_y and y >= self.max_scroll_y:
2430+
self._user_scroll_interrupt = False
2431+
24312432
if animate:
24322433
# TODO: configure animation speed
24332434
if duration is None and speed is None:
@@ -2550,6 +2551,11 @@ def scroll_to(
25502551
Note:
25512552
The call to scroll is made after the next refresh.
25522553
"""
2554+
animator = self.app.animator
2555+
if x is not None:
2556+
animator.force_stop_animation(self, "scroll_x")
2557+
if y is not None:
2558+
animator.force_stop_animation(self, "scroll_y")
25532559
if immediate:
25542560
self._scroll_to(
25552561
x,

0 commit comments

Comments
 (0)