From 7ba9876fa4586cf50c8110b0807f0bb3ca65e8ed Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Mon, 1 Dec 2025 23:44:01 -0500 Subject: [PATCH] ui: recreate search dialog with the latest query (#1542) --- system/ui/sunnypilot/widgets/tree_dialog.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/system/ui/sunnypilot/widgets/tree_dialog.py b/system/ui/sunnypilot/widgets/tree_dialog.py index a8947a9b18..fd2a576d58 100644 --- a/system/ui/sunnypilot/widgets/tree_dialog.py +++ b/system/ui/sunnypilot/widgets/tree_dialog.py @@ -98,12 +98,7 @@ class TreeOptionDialog(MultiOptionDialog): # Default title & overridable subtitle for InputDialogSP self.search_title = search_title or tr("Enter search query") self.search_subtitle = search_subtitle - self.search_dialog = InputDialogSP( - self.search_title, - self.search_subtitle, - current_text=self.query, - callback=self._on_search_confirm, - ) + self.search_dialog = None self._build_visible_items() @@ -114,6 +109,12 @@ class TreeOptionDialog(MultiOptionDialog): gui_app.set_modal_overlay(self, callback=self.on_exit) def _on_search_clicked(self): + self.search_dialog = InputDialogSP( + self.search_title, + self.search_subtitle, + current_text=self.query, + callback=self._on_search_confirm, + ) self.search_dialog.show() def _toggle_folder(self, folder):