From 61225dab5bac1bde95ac3ee8ef2da05bb21fb410 Mon Sep 17 00:00:00 2001 From: Soner YUKSEL Date: Tue, 25 Jul 2023 12:15:51 -0400 Subject: [PATCH] Fix #7737: Crash at Browsing Mode Change while drag-drop action in Tab Tray (#7778) Adding check for active drag and drop while mode change --- .../Frontend/Browser/Tabs/TabTray/TabTrayController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/Brave/Frontend/Browser/Tabs/TabTray/TabTrayController.swift b/Sources/Brave/Frontend/Browser/Tabs/TabTray/TabTrayController.swift index af6005e341b..e5cd30b65d6 100644 --- a/Sources/Brave/Frontend/Browser/Tabs/TabTray/TabTrayController.swift +++ b/Sources/Brave/Frontend/Browser/Tabs/TabTray/TabTrayController.swift @@ -588,6 +588,12 @@ class TabTrayController: LoadingViewController { @objc func togglePrivateModeAction() { tabTraySearchController.isActive = false + + // Mode Change action disabled while drap-drop is active + // Added to prevent Diffable Data source crash + if tabTrayView.collectionView.hasActiveDrag || tabTrayView.collectionView.hasActiveDrop { + return + } // Record the slected index before private mode navigation if !privateMode {