LibGUI: Fix AbstractView selection after initial focusin event

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

Fixes #3925.
This commit is contained in:
Joseph Bywater 2020-11-03 00:17:02 +00:00 committed by Andreas Kling
parent dec6c0a207
commit 15bc42479a
Notes: sideshowbarker 2024-07-19 17:32:34 +09:00

View file

@ -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();
}
}
}