Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't show bindings first compose #4584

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading