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

Bug: Disable boomark reordering when searching #3188

Merged
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,13 @@ final class BookmarkOutlineViewDataSource: NSObject, BookmarksOutlineViewDataSou
}

let destination = destinationNode.isRoot ? PseudoFolder.bookmarks : destinationNode.representedObject

guard !isSearching || destination is BookmarkFolder else { return .none }

if let destinationFolder = destination as? BookmarkFolder {
self.dragDestinationFolder = destinationFolder
}

let operation = dragDropManager.validateDrop(info, to: destination)
self.dragDestinationFolder = (operation == .none || item == nil) ? nil : destinationNode.representedObject as? BookmarkFolder

Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Bookmarks/View/BookmarkListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ final class BookmarkListViewController: NSViewController {
expandFoldersAndScrollUntil(folder)
outlineView.scrollToAdjustedPositionInOutlineView(folder)

guard let node = treeController.node(representing: folder) else { return }
guard let node = treeController.findNodeWithId(representing: folder) else { return }

outlineView.highlight(node)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ extension BookmarkManagementDetailViewController: NSTableViewDelegate, NSTableVi
proposedRow row: Int,
proposedDropOperation dropOperation: NSTableView.DropOperation) -> NSDragOperation {
let destination = destination(for: dropOperation, at: row)

guard !isSearching || destination is BookmarkFolder else { return .none }

return dragDropManager.validateDrop(info, to: destination)
}

Expand Down
Loading