Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/textual/widgets/_data_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1317,8 +1317,8 @@ def validate_cursor_coordinate(self, value: Coordinate) -> Coordinate:
def _clamp_cursor_coordinate(self, coordinate: Coordinate) -> Coordinate:
"""Clamp a coordinate such that it falls within the boundaries of the table."""
row, column = coordinate
row = clamp(row, 0, self.row_count - 1)
column = clamp(column, 0, len(self.columns) - 1)
row = clamp(row, 0, max(0, self.row_count - 1))
column = clamp(column, 0, max(0, len(self.columns) - 1))
return Coordinate(row, column)

def watch_cursor_type(self, old: str, new: str) -> None:
Expand Down
Loading