textual
textual copied to clipboard
Footer() not visible
It seems screen height suffers from some sort of off-by-one bug. This testcase:
from textual.app import App
from textual.widgets import Footer, Placeholder
class MainApp(App):
async def on_mount(self) -> None:
await self.view.dock(Placeholder())
await self.view.dock(Footer(), edge="bottom")
if __name__ == "__main__":
MainApp.run()
produces this output::
The bottom line is cut off. Without the Placeholder widget, the Footer displays correctly at the bottom line:
For what it's worth, applying the elements in reverse order works:
from textual.app import App
from textual.widgets import Footer, Placeholder
class MainApp(App):
async def on_mount(self) -> None:
await self.view.dock(Footer(), edge="bottom")
await self.view.dock(Placeholder())
if __name__ == "__main__":
MainApp.run()
You could also apply the widgets at once-- await self.view.dock(Placeholder(), Footer(), edge="top")
so they can work out a fair arrangement with each other.
The way my mental model interprets this is-- when you placed the Placeholder()
the 'canvas' was empty, so Placeholder naturally grows to fully encompass everything. When you then add the Footer()
the top of the footer has to touch the bottom of the Placeholder, so it therefore 'scrolls' offscreen.
(my mental model could well be wrong! I'm only new to exploring this project)
https://github.com/Textualize/textual/wiki/Sorry-we-closed-your-issue
Did we solve your problem?
Glad we could help!