diff --git a/CHANGELOG.md b/CHANGELOG.md index cd28386fd5..cdd8bd1d4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/textual/widgets/_tree.py b/src/textual/widgets/_tree.py index c95fb9c792..5a4ca1f9b7 100644 --- a/src/textual/widgets/_tree.py +++ b/src/textual/widgets/_tree.py @@ -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