Skip to content

Commit 41a0020

Browse files
committed
fix(option list): fix size when options removed
Fix the OptionList size not updating correctly after removing options. Fixes #5728 (comment)
1 parent fd6cb52 commit 41a0020

File tree

3 files changed

+178
-1
lines changed

3 files changed

+178
-1
lines changed

src/textual/widgets/_option_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ def _remove_option(self, option: Option) -> Self:
534534
del self._id_to_option[option._id]
535535
del self._option_to_index[option]
536536
self.highlighted = self.highlighted
537-
self.refresh()
537+
self._clear_caches()
538538
return self
539539

540540
def _pre_remove_option(self, option: Option, index: int) -> None:

0 commit comments

Comments
 (0)