Skip to content

Commit

Permalink
Only clear the selection if the selection needs to change. (#689)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1199230911884351/1202801432128120/f
Tech Design URL:
CC:

Description:

This PR fixes an issue where tabs opened in the background would cause the current tab selection to be cleared.
  • Loading branch information
samsymons authored Aug 15, 2022
1 parent 3f6e6c5 commit 8a1a8bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion DuckDuckGo/Tab Bar/View/TabBarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,10 @@ extension TabBarViewController: TabCollectionViewModelDelegate {
}
updateTabMode(for: collectionView.numberOfItems(inSection: 0) + 1)

collectionView.clearSelection()
if selected {
collectionView.clearSelection()
}

if tabMode == .divided {
collectionView.animator().insertItems(at: lastIndexPathSet)
if selected {
Expand Down

0 comments on commit 8a1a8bd

Please sign in to comment.