From 6949053539de25e885a292d1987c61209ffd59db Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Mon, 20 Jan 2025 11:36:15 +0000 Subject: [PATCH] :bug: https://github.com/Textualize/textual/issues/5488 workaround --- src/peplum/app/widgets/pep_details.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/peplum/app/widgets/pep_details.py b/src/peplum/app/widgets/pep_details.py index 5cb4f38..eca9028 100644 --- a/src/peplum/app/widgets/pep_details.py +++ b/src/peplum/app/widgets/pep_details.py @@ -10,8 +10,10 @@ ############################################################################## # Textual imports. +from textual import on from textual.app import ComposeResult from textual.containers import Vertical, VerticalScroll +from textual.events import DescendantBlur, DescendantFocus from textual.reactive import var from textual.widgets import Label, OptionList @@ -170,6 +172,13 @@ def compose(self) -> ComposeResult: with Field("URL"): yield URL(id="url") + @on(DescendantBlur) + @on(DescendantFocus) + def _textual_5488_workaround(self) -> None: + """Workaround for https://github.com/Textualize/textual/issues/5488""" + for widget in self.query(List): + widget._refresh_lines() + def watch_pep(self) -> None: """React to the PEP being changed.""" with self.app.batch_update():