1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:17:35 +00:00

Spreadsheet: Only update the selection on primary mousedown

Otherwise we'd end up clearing the selected rect before doing anything
with it if the user right-clicks on it.
This commit is contained in:
Ali Mohammad Pur 2022-03-20 12:33:05 +03:30 committed by Linus Groh
parent 0d302516d5
commit 8919e4b2b6

View file

@ -206,8 +206,10 @@ void InfinitelyScrollableTableView::mousedown_event(GUI::MouseEvent& event)
AbstractTableView::mousedown_event(adjusted_event);
} else {
AbstractTableView::mousedown_event(event);
auto index = index_at_event_position(event.position());
AbstractTableView::set_cursor(index, SelectionUpdate::Set);
if (event.button() == GUI::Primary) {
auto index = index_at_event_position(event.position());
AbstractTableView::set_cursor(index, SelectionUpdate::Set);
}
}
}