Skip to content

Commit

Permalink
refresh bindings on auto focus
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed May 24, 2024
1 parent 6034065 commit fa8ddd5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
from ._worker_manager import WorkerManager
from .actions import ActionParseResult, SkipAction
from .await_remove import AwaitRemove
from .binding import Binding, BindingType
from .binding import Binding, BindingType, _Bindings
from .command import CommandPalette, Provider
from .css.errors import StylesheetError
from .css.query import NoMatches
Expand Down
1 change: 1 addition & 0 deletions src/textual/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ def scroll_to_center(widget: Widget) -> None:
self.log.debug(widget, "was focused")

self._update_focus_styles(focused, blurred)
self.call_after_refresh(self.refresh_bindings)

def _extend_compose(self, widgets: list[Widget]) -> None:
"""Insert Textual's own internal widgets.
Expand Down
2 changes: 1 addition & 1 deletion src/textual/widgets/_footer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def render(self) -> Text:
key_display = self.key_display
if self.upper_case_keys:
key_display = key_display.upper()
if key_display.lower().startswith("ctrl+"):
if self.ctrl_to_caret and key_display.lower().startswith("ctrl+"):
key_display = "^" + key_display.split("+", 1)[1]
description = self.description
if self.compact:
Expand Down

0 comments on commit fa8ddd5

Please sign in to comment.