mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge pull request #1799 from Textualize/datatable-fixed-column-cursor
DataTable - allow the cursor to enter fixed columns
This commit is contained in:
@@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- `DOMNode.tree` now displays simple DOM structure only https://github.com/Textualize/textual/pull/1778
|
||||
- `App.install_screen` now returns None rather than AwaitMount https://github.com/Textualize/textual/pull/1778
|
||||
- `DOMNode.children` is now a simple sequence, the NodesList is exposed as `DOMNode._nodes` https://github.com/Textualize/textual/pull/1778
|
||||
- `DataTable` cursor can now enter fixed columns https://github.com/Textualize/textual/pull/1799
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
@@ -877,7 +877,7 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
|
||||
"""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, self.fixed_columns, len(self.columns) - 1)
|
||||
column = clamp(column, 0, len(self.columns) - 1)
|
||||
return Coordinate(row, column)
|
||||
|
||||
def watch_cursor_type(self, old: str, new: str) -> None:
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user