From aff9bcdf9365d835e02e36a75b16f38b19e6c538 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Mon, 15 May 2023 11:30:26 +0100 Subject: [PATCH] Fix clearing an OptionList See #2557, credit to Will: https://github.com/Textualize/textual/issues/2557#issuecomment-1546883815 --- src/textual/widgets/_option_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/textual/widgets/_option_list.py b/src/textual/widgets/_option_list.py index 3b9413181..7d9af219b 100644 --- a/src/textual/widgets/_option_list.py +++ b/src/textual/widgets/_option_list.py @@ -631,7 +631,7 @@ class OptionList(ScrollView, can_focus=True): self.highlighted = None self._mouse_hovering_over = None self.virtual_size = Size(self.scrollable_content_region.width, 0) - self.refresh() + self._request_content_tracking_refresh() return self def _set_option_disabled(self, index: int, disabled: bool) -> Self: