Przeglądaj źródła

LibGUI: Fix AbstractView selection after initial focusin event

After moving the cursor to the home position, clear the
selection.

Fixes #3925.
Joseph Bywater 4 lat temu
rodzic
commit
15bc42479a
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      Libraries/LibGUI/AbstractView.cpp

+ 3 - 1
Libraries/LibGUI/AbstractView.cpp

@@ -710,8 +710,10 @@ void AbstractView::focusin_event(FocusEvent& event)
 {
     ScrollableWidget::focusin_event(event);
 
-    if (model() && !cursor_index().is_valid())
+    if (model() && !cursor_index().is_valid()) {
         move_cursor(CursorMovement::Home, SelectionUpdate::None);
+        clear_selection();
+    }
 }
 
 }