Skip to content

Commit 7381e9c

Browse files
committed
fix(option list): fix render cache option indexing
Fixes Textualize#5431
1 parent dc71564 commit 7381e9c

File tree

3 files changed

+185
-2
lines changed

3 files changed

+185
-2
lines changed

src/textual/widgets/_option_list.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,11 @@ def _add_lines(
358358
assert self._lines is not None
359359
assert self._spans is not None
360360

361-
for index, content in enumerate(new_content, len(self._lines)):
361+
for content in new_content:
362362
if isinstance(content, Option):
363363
height = len(
364364
self._render_option_content(
365-
index, content, "", width - self._left_gutter_width()
365+
option_index, content, "", width - self._left_gutter_width()
366366
)
367367
)
368368

0 commit comments

Comments
 (0)