Skip to content

Commit

Permalink
Merge pull request #4584 from Textualize/footer-flicker
Browse files Browse the repository at this point in the history
don't show bindings first compose
  • Loading branch information
willmcgugan authored Jun 2, 2024
2 parents 5314acc + 866e839 commit 7866974
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions src/textual/widgets/_footer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 7866974

Please sign in to comment.