Skip to content

Commit 0fc170f

Browse files
authored
fix: Don't clear the selection when clicking on selected cells (#20)
1 parent 1f2da37 commit 0fc170f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Sources/SelectableCollectionView/Views/InteractiveCollectionView.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ class InteractiveCollectionView: NSCollectionView {
158158
cursor = indexPath
159159
}
160160

161-
} else {
161+
} else if !selectionIndexPaths.contains(indexPath) {
162+
163+
// Select a clicked item if it's not within the current selection.
162164

163165
let selectionIndexPaths = selectionIndexPaths
164166
deselectItems(at: selectionIndexPaths)

0 commit comments

Comments
 (0)