Skip to content

Commit e27bcda

Browse files
authored
Merge pull request #5681 from Textualize/table-overflow
fix table scroll
2 parents 8ca3a1b + 812bee7 commit e27bcda

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2525
- Fixed additional spaces after text-wrapping https://github.com/Textualize/textual/pull/5657
2626
- Added missing `scroll_end` parameter to the `Log.write_line` method https://github.com/Textualize/textual/pull/5672
2727
- Restored support for blink https://github.com/Textualize/textual/pull/5675
28+
- Fixed scrolling breaking on DataTable with `overflow: hidden` https://github.com/Textualize/textual/pull/5681
2829

2930
### Added
3031

src/textual/scroll_view.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ def is_scrollable(self) -> bool:
3333
return True
3434

3535
def watch_scroll_x(self, old_value: float, new_value: float) -> None:
36-
if self.show_horizontal_scrollbar and old_value != new_value:
36+
if self.show_horizontal_scrollbar:
3737
self.horizontal_scrollbar.position = new_value
38+
if round(old_value) != round(new_value):
3839
self.refresh()
3940

4041
def watch_scroll_y(self, old_value: float, new_value: float) -> None:
41-
if self.show_vertical_scrollbar and (old_value) != (new_value):
42+
if self.show_vertical_scrollbar:
4243
self.vertical_scrollbar.position = new_value
44+
if round(old_value) != round(new_value):
4345
self.refresh()
4446

4547
def on_mount(self):
@@ -174,7 +176,6 @@ def refresh_lines(self, y_start: int, line_count: int = 1) -> None:
174176
y_start: First line to refresh.
175177
line_count: Total number of lines to refresh.
176178
"""
177-
178179
refresh_region = Region(
179180
0,
180181
y_start - self.scroll_offset.y,

src/textual/widget.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4003,7 +4003,6 @@ def refresh(
40034003
Returns:
40044004
The `Widget` instance.
40054005
"""
4006-
40074006
if layout:
40084007
self._layout_required = True
40094008
for ancestor in self.ancestors:

0 commit comments

Comments
 (0)