Skip to content

Commit

Permalink
Merge pull request #3786 from davep/force-tree-node-scroll
Browse files Browse the repository at this point in the history
Force the call to scroll to the region of a node's label
  • Loading branch information
davep authored Dec 7, 2023
2 parents 2a67b6d + 817af47 commit de83fae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- `link-hover-background` renamed to `link-background-hover`
- `link-hover-color` renamed to `link-color-hover`
- `link-hover-style` renamed to `link-style-hover`
- `Tree` now forces a scroll when `scroll_to_node` is called https://github.com/Textualize/textual/pull/3786
- Brought rxvt's use of shift-numpad keys in line with most other terminals https://github.com/Textualize/textual/pull/3769

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ def scroll_to_line(self, line: int, animate: bool = True) -> None:
"""
region = self._get_label_region(line)
if region is not None:
self.scroll_to_region(region, animate=animate)
self.scroll_to_region(region, animate=animate, force=True)

def scroll_to_node(
self, node: TreeNode[TreeDataType], animate: bool = True
Expand Down

0 comments on commit de83fae

Please sign in to comment.