Skip to content

Commit 1668472

Browse files
committed
remove call_after_refresh
1 parent 2fb527b commit 1668472

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/textual/widgets/_select.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ def _watch_expanded(self, expanded: bool) -> None:
610610
value = self.value
611611
for index, (_prompt, prompt_value) in enumerate(self._options):
612612
if value == prompt_value:
613-
self.call_after_refresh(overlay.select, index)
613+
overlay.select(index)
614614
break
615615
self.query_one(SelectCurrent).has_value = True
616616

@@ -637,12 +637,8 @@ def _update_selection(self, event: SelectOverlay.UpdateSelection) -> None:
637637
if value != self.value:
638638
self.value = value
639639

640-
async def update_focus() -> None:
641-
"""Update focus and reset overlay."""
642-
self.focus()
643-
self.expanded = False
644-
645-
self.call_after_refresh(update_focus) # Prevents a little flicker
640+
self.focus()
641+
self.expanded = False
646642

647643
def action_show_overlay(self) -> None:
648644
"""Show the overlay."""

0 commit comments

Comments
 (0)