diff --git a/src/textual/command.py b/src/textual/command.py index 04e5b60eaf..d45d941d85 100644 --- a/src/textual/command.py +++ b/src/textual/command.py @@ -586,6 +586,7 @@ def _show_no_matches() -> None: id=self._NO_MATCHES, ) ) + self._list_visible = True self._no_matches_timer = self.set_timer( self._NO_MATCHES_COUNTDOWN, @@ -765,6 +766,7 @@ def _refresh_command_list( command_list.clear_options().add_options(sorted(commands, reverse=True)) if highlighted is not None: command_list.highlighted = command_list.get_option_index(highlighted.id) + self._list_visible = bool(command_list.option_count) _RESULT_BATCH_TIME: Final[float] = 0.25 """How long to wait before adding commands to the command list.""" @@ -813,10 +815,7 @@ async def _gather_commands(self, search_value: str) -> None: # grab a reference to that. worker = get_current_worker() - # We're ready to show results, ensure the list is visible. - self._list_visible = True - - # Go into a busy mode. + # Reset busy mode. self._show_busy = False # A flag to keep track of if the current content of the command hit