Pārlūkot izejas kodu

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.
Ali Mohammad Pur 3 gadi atpakaļ
vecāks
revīzija
8919e4b2b6

+ 4 - 2
Userland/Applications/Spreadsheet/SpreadsheetView.cpp

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