Merge pull request #841 from jinsu35/fix-issue-744

Fix bug - scrollToTop() should be called when current tab is selected
This commit is contained in:
Nathan Mattes 2023-11-21 17:18:19 +01:00 committed by GitHub
commit dd0025cdae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -490,7 +490,7 @@ extension MainTabBarController: UITabBarControllerDelegate {
// Assert index is as same as the tab rawValue. This check needs to be done `shouldSelect`
// because the nav controller has already popped in `didSelect`.
if currentTab.rawValue == tabBarController.selectedIndex,
if currentTab.rawValue == viewController.tabBarItem.tag,
let navigationController = viewController as? UINavigationController,
navigationController.viewControllers.count == 1,
let scrollViewContainer = navigationController.topViewController as? ScrollViewContainer {