diff --git a/CHANGELOG.md b/CHANGELOG.md index dc7242d4ed..1a4994aec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed - Fixed `Markdown.goto_anchor` no longer scrolling the heading into view https://github.com/Textualize/textual/pull/4583 +- Fixed Footer flicker on initial focus https://github.com/Textualize/textual/issues/4573 ## [0.63.6] - 2024-05-29 diff --git a/src/textual/widgets/_footer.py b/src/textual/widgets/_footer.py index 811ef2b76f..5309ee0e83 100644 --- a/src/textual/widgets/_footer.py +++ b/src/textual/widgets/_footer.py @@ -132,8 +132,12 @@ class Footer(ScrollableContainer, can_focus=False, can_focus_children=False): """Convert 'ctrl+' prefix to '^'.""" compact = reactive(False) """Display in compact style.""" + _bindings_ready = reactive(False, repaint=False) + """True if the bindings are ready to be displayed.""" def compose(self) -> ComposeResult: + if not self._bindings_ready: + return bindings = [ (binding, enabled) for (_, binding, enabled) in self.screen.active_bindings.values() @@ -162,6 +166,7 @@ def compose(self) -> ComposeResult: def on_mount(self) -> None: async def bindings_changed(screen: Screen) -> None: + self._bindings_ready = True if self.is_attached and screen is self.screen: await self.recompose()