mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibGUI: Fix invalid ModelIndices during shift-click multiselection
Previously, If the widget was unfocused, the selection start index would be invalid. This would result in invalid selections when doing shift+click on the widget (while it is unfocused). Now, we reassign the selection start index to current index before we initiate multiselection, if selection start index is invalid. Should Fix SerenityOS#11999 and the same bug inside FileManager.
This commit is contained in:
parent
5f67d002a2
commit
7a4b912ece
Notes:
sideshowbarker
2024-07-17 02:24:14 +09:00
Author: https://github.com/iyush
Commit: 7a4b912ece
Pull-request: https://github.com/SerenityOS/serenity/pull/16704
Issue: https://github.com/SerenityOS/serenity/issues/11999
Reviewed-by: https://github.com/TobyAsE ✅
1 changed files with 2 additions and 0 deletions
|
@ -493,6 +493,8 @@ void AbstractView::set_cursor(ModelIndex index, SelectionUpdate selection_update
|
|||
if (!m_selection.contains(index))
|
||||
clear_selection();
|
||||
} else if (selection_update == SelectionUpdate::Shift) {
|
||||
if (!selection_start_index().is_valid())
|
||||
set_selection_start_index(index);
|
||||
select_range(index);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue