Skip to content

Commit 979a2d5

Browse files
committed
scroll to 0,0 on clear options
1 parent 10c84c7 commit 979a2d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/textual/widgets/_option_list.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ def clear_options(self) -> Self:
311311
self._option_to_index.clear()
312312
self.highlighted = None
313313
self.refresh()
314+
self.scroll_to(0, 0, animate=False)
315+
self._update_lines()
314316
return self
315317

316318
def add_options(self, new_options: Iterable[OptionListContent]) -> Self:

0 commit comments

Comments
 (0)