mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
Spreadsheet: Handle case when drag-and-drop location is out of bounds
When the drop location of a drag-and-drop operation is not valid, then don't continue with the drop_event. For example, if the ending location is the header row or header column, or is outside of the table, then should not continue.
This commit is contained in:
parent
9e54815799
commit
5759b25ca8
Notes:
sideshowbarker
2024-07-17 17:08:12 +09:00
Author: https://github.com/martinfalisse
Commit: 5759b25ca8
Pull-request: https://github.com/SerenityOS/serenity/pull/12280
Reviewed-by: https://github.com/alimpfard
1 changed files with 4 additions and 1 deletions
|
@ -246,9 +246,12 @@ void InfinitelyScrollableTableView::mouseup_event(GUI::MouseEvent& event)
|
|||
|
||||
void InfinitelyScrollableTableView::drop_event(GUI::DropEvent& event)
|
||||
{
|
||||
TableView::drop_event(event);
|
||||
m_is_dragging_for_cut = false;
|
||||
set_override_cursor(Gfx::StandardCursor::Arrow);
|
||||
if (!index_at_event_position(event.position()).is_valid())
|
||||
return;
|
||||
|
||||
TableView::drop_event(event);
|
||||
auto drop_index = index_at_event_position(event.position());
|
||||
if (selection().size() > 0) {
|
||||
// Get top left index position of previous selection
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue