Skip to content

Commit

Permalink
fix select
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Jul 22, 2024
1 parent 252e9e7 commit 2594a49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/textual/widgets/_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,10 @@ def _on_mount(self, _event: events.Mount) -> None:

def _watch_expanded(self, expanded: bool) -> None:
"""Display or hide overlay."""
overlay = self.query_one(SelectOverlay)
try:
overlay = self.query_one(SelectOverlay)
except NoMatches:
return
self.set_class(expanded, "-expanded")
if expanded:
overlay.focus()
Expand Down

0 comments on commit 2594a49

Please sign in to comment.