Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix items deselection #1054

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Zotero/Scenes/Detail/Items/Views/ItemsTableViewHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ protocol ItemsTableViewHandlerDelegate: AnyObject {
var isInViewHierarchy: Bool { get }
var collectionKey: String? { get }
var library: Library { get }
var isEditing: Bool { get }

func process(action: ItemAction.Kind, at index: Int, completionAction: ((Bool) -> Void)?)
func process(tapAction action: ItemsTableViewHandler.TapAction)
Expand Down Expand Up @@ -84,7 +83,7 @@ final class ItemsTableViewHandler: NSObject {
}

func attachmentAccessoriesChanged() {
if delegate.isEditing && !dataSource.selectedItems.isEmpty {
if tableView.isEditing, !dataSource.selectedItems.isEmpty {
// Accessories changed by user, reload only selected items
reloadSelected()
} else {
Expand Down Expand Up @@ -281,7 +280,7 @@ extension ItemsTableViewHandler: UITableViewDelegate {
}

func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
guard delegate.isEditing, let object = dataSource.object(at: indexPath.row) else { return }
guard tableView.isEditing, let object = dataSource.object(at: indexPath.row) else { return }
delegate.process(tapAction: .deselectItem(object))
}

Expand Down