Skip to content

Commit 7332aa2

Browse files
committed
💩 Work around Textualize/textual#5488
1 parent da0216a commit 7332aa2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/hike/widgets/navigation/widget.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
##############################################################################
44
# Textual imports.
5+
from textual import on
56
from textual.app import ComposeResult
67
from textual.containers import Vertical
8+
from textual.events import DescendantBlur, DescendantFocus
79
from textual.reactive import var
810
from textual.widgets import Placeholder, TabbedContent
911

@@ -34,6 +36,13 @@ class Navigation(Vertical):
3436
_history: var[HistoryView | None] = var(None)
3537
"""The history display."""
3638

39+
@on(DescendantBlur)
40+
@on(DescendantFocus)
41+
def _textual_5488_workaround(self) -> None:
42+
"""Workaround for https://github.com/Textualize/textual/issues/5488"""
43+
for widget in self.query(HistoryView):
44+
widget._refresh_lines()
45+
3746
def _watch_dock_right(self) -> None:
3847
"""React to the dock toggle being changed."""
3948
self.set_class(self.dock_right, "--dock-right")

0 commit comments

Comments
 (0)