Skip to content

Commit

Permalink
🐛 Improve the accuracy of select asset on iOS device
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiJun0507 committed Jan 4, 2025
1 parent 8580c40 commit 60239f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/src/delegates/asset_grid_drag_selection_coordinator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ class AssetGridDragSelectionCoordinator {
rowIndex -= deductedRow;
}

if (placeholderCount > 0 && maxRow > maxRowPerPage) {
if (placeholderCount > 0 &&
maxRow > maxRowPerPage &&
rowIndex > 0 &&
anchor < 1.0) {
rowIndex -= 1;
}

Expand Down Expand Up @@ -226,7 +229,8 @@ class AssetGridDragSelectionCoordinator {
}

final stopAutoScroll = switch (addSelected) {
true => provider.selectedAssets.length == provider.maxAssets,
true => provider.selectedAssets.length == provider.maxAssets ||
(gridRevert && delegate.gridScrollController.offset == 0.0),
false => provider.selectedAssets.isEmpty,
};

Expand Down

0 comments on commit 60239f6

Please sign in to comment.