-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Closed
Copy link
Labels
Description
When working on #2031 we realised that there is an issue with the compositor _full_map on app startup, in that it does not contain the widgets that are nested within the DOM.
To reproduce:
- Run the app below and connect to the console.
- Press
Pafter app startup and note the size of the map that is printed. - Scroll the app to the very bottom.
- Press
Pagain. - Notice that the map that was printed now is significantly bigger.
App
from textual.app import App, ComposeResult
from textual.containers import VerticalScroll
from textual.widgets import Label
class MyApp(App[None]):
def compose(self) -> ComposeResult:
with VerticalScroll():
yield Label("v\n" * 500)
with VerticalScroll():
for i in range(15):
yield Label(str(i))
with VerticalScroll():
for i in range(35):
yield Label(str(i))
def key_p(self) -> None:
print(self.screen._compositor._full_map)
if __name__ == "__main__":
MyApp().run()