Skip to content

Commit ecf503d

Browse files
committed
Fix news screen auto-scrolls to top when opened from another tab
1 parent 8598245 commit ecf503d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ForPDA/Sources/Views/TabBarControllers/PDATabBarController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class PDATabBarController: UITabBarController, UITabBarControllerDelegate
2929
// Tap on tabbar to scroll news to the top
3030
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
3131
guard let viewControllers, !viewControllers.isEmpty else { return true }
32-
guard viewController == viewControllers[0] else { return true }
32+
guard viewController == viewControllers[0] && selectedIndex == 0 else { return true }
3333
guard let navController = viewController as? UINavigationController else { return true }
3434
guard let topController = navController.viewControllers.last else { return true }
3535

0 commit comments

Comments
 (0)