From c915fac1e52cc1c1f07fb5962401c0b4574310a7 Mon Sep 17 00:00:00 2001 From: Gleb Smirnov Date: Sun, 23 Oct 2022 13:54:28 +0300 Subject: [PATCH] fix: Maintain selected row even after search changed --- src/Window.vala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Window.vala b/src/Window.vala index 1076bc9..edfe97b 100644 --- a/src/Window.vala +++ b/src/Window.vala @@ -400,6 +400,13 @@ namespace TextPieces { search_sorter.changed (DIFFERENT); search_filter.changed (DIFFERENT); + /* Select the first row if no row is selected */ + if (search_listbox.get_selected_row () == null) { + search_listbox.select_row ( + search_listbox.get_row_at_index (0) + ); + } + /* Show placeholder if there are no tools found */ search_stack.set_visible_child_name (