This commit is contained in:
Will McGugan
2023-02-24 10:13:58 +00:00
parent c5cb0100ff
commit 5a77e3493d
3 changed files with 21 additions and 4 deletions

View File

@@ -30,6 +30,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Numbers in a descendant-combined selector no longer cause an error https://github.com/Textualize/textual/issues/1836 - Numbers in a descendant-combined selector no longer cause an error https://github.com/Textualize/textual/issues/1836
- Fixed superfluous scrolling when focusing a docked widget https://github.com/Textualize/textual/issues/1816 - Fixed superfluous scrolling when focusing a docked widget https://github.com/Textualize/textual/issues/1816
- Fixes walk_children which was returning more than one screen https://github.com/Textualize/textual/issues/1846
- Fixed issue with watchers fired for detached nodes https://github.com/Textualize/textual/issues/1846
## [0.11.1] - 2023-02-17 ## [0.11.1] - 2023-02-17

View File

@@ -239,7 +239,6 @@ class Reactive(Generic[ReactiveType]):
) )
) )
if obj.is_attached:
watch_function = getattr(obj, f"watch_{name}", None) watch_function = getattr(obj, f"watch_{name}", None)
if callable(watch_function): if callable(watch_function):
invoke_watcher(watch_function, old_value, value) invoke_watcher(watch_function, old_value, value)

View File

@@ -11,6 +11,22 @@ skip_py310 = pytest.mark.skipif(
) )
async def test_screen_walk_children():
"""Test query only reports active screen."""
class ScreensApp(App):
pass
app = ScreensApp()
async with app.run_test() as pilot:
screen1 = Screen()
screen2 = Screen()
pilot.app.push_screen(screen1)
assert list(pilot.app.query("*")) == [screen1]
pilot.app.push_screen(screen2)
assert list(pilot.app.query("*")) == [screen2]
async def test_installed_screens(): async def test_installed_screens():
class ScreensApp(App): class ScreensApp(App):
SCREENS = { SCREENS = {