From 4b4ee95cdb9dcf33395a99a417f961b82ed7d1c3 Mon Sep 17 00:00:00 2001 From: Vrins Date: Thu, 17 Feb 2022 18:42:02 +0100 Subject: [PATCH] LibGUI: Set cursor when using highlighted_search in abstractview Previously using the highlighted_search would not set the cursor to the item found by the search. This results in some unfamiliar behavior such as jumping back up to the previously selected element, before searching, when using the arrow keys to navigate. --- Userland/Libraries/LibGUI/AbstractView.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp index 5c069ce8bf..2bdedc71bd 100644 --- a/Userland/Libraries/LibGUI/AbstractView.cpp +++ b/Userland/Libraries/LibGUI/AbstractView.cpp @@ -613,6 +613,7 @@ void AbstractView::keydown_event(KeyEvent& event) m_highlighted_search = sb.to_string(); highlight_search(index); start_highlighted_search_timer(); + set_cursor(index, SelectionUpdate::None, true); } event.accept();