Add always_update as a parameter for a var reactive

This commit is contained in:
Dave Pearson
2023-05-04 14:16:34 +01:00
parent 805970193b
commit f6da3e9fb2
2 changed files with 2 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- The DataTable cursor is now scrolled into view when the cursor coordinate is changed programmatically https://github.com/Textualize/textual/issues/2459
- Added `always_update` as an optional argument for `reactive.var`
## [0.23.0] - 2023-05-03

View File

@@ -429,7 +429,7 @@ class Tree(Generic[TreeDataType], ScrollView, can_focus=True):
"""Show the root of the tree."""
hover_line = var(-1)
"""The line number under the mouse pointer, or -1 if not under the mouse pointer."""
cursor_line = var(-1)
cursor_line = var(-1, always_update=True)
"""The line with the cursor, or -1 if no cursor."""
show_guides = reactive(True)
"""Enable display of tree guide lines."""