Skip to content

Commit faac1a3

Browse files
committed
fix refresh
1 parent dcb9229 commit faac1a3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/textual/widgets/_option_list.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,8 +366,7 @@ def _add_lines(
366366

367367
def _populate(self) -> None:
368368
"""Populate the lines data-structure."""
369-
if self._lines is not None:
370-
return
369+
371370
self._lines = []
372371
self._spans = []
373372

@@ -825,6 +824,8 @@ def get_option_index(self, option_id: str) -> int:
825824

826825
def render_line(self, y: int) -> Strip:
827826
assert self._lines is not None
827+
if not self._lines:
828+
self._populate()
828829

829830
_scroll_x, scroll_y = self.scroll_offset
830831
line_number = scroll_y + y

0 commit comments

Comments
 (0)