Skip to content

Commit 950bbcc

Browse files
committed
fix index error
1 parent 699cc86 commit 950bbcc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/textual/widgets/_option_list.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,10 @@ def render_line(self, y: int) -> Strip:
853853
style = self.get_visual_style("option-list--option")
854854

855855
strips = self._get_option_render(option, style)
856-
strip = strips[line_offset]
856+
try:
857+
strip = strips[line_offset]
858+
except IndexError:
859+
return Strip.blank(self.scrollable_content_region.width)
857860
return strip
858861

859862
def validate_highlighted(self, highlighted: int | None) -> int | None:

0 commit comments

Comments
 (0)