Skip to content

Commit 606fc1c

Browse files
authored
Merge pull request #5574 from Textualize/fix-ol-render-line
Fix ol render line
2 parents 49ff0e0 + 133656e commit 606fc1c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Fixed
1111

1212
- Fixed `Link` binding to open the link https://github.com/Textualize/textual/issues/5564
13+
- Fixed IndexError in OptionList https://github.com/Textualize/textual/pull/5574
1314
- Fixed issue with clear_panes breaking tabbed content https://github.com/Textualize/textual/pull/5573
1415

1516
## [2.1.0] - 2025-02-19

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)