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

Tab bar scrolling fixed #3793

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Tab bar scrolling fixed #3793

wants to merge 2 commits into from

Conversation

tomasstrba
Copy link
Contributor

@tomasstrba tomasstrba commented Jan 28, 2025

Task/Issue URL: https://app.asana.com/0/1201048563534612/1209257294295137/f

Description:
Scrolling to the new open tab fixed.

Steps to test this PR:

  1. Open many tabs to reach overflow state in the tab bar
  2. On the last tab, visit www.wikipedia.org
  3. Hold CMD + SHIFT and click on a random link to open and select a new tab
  4. Make sure the new tab is fully visible in the tab bar and you can see its close button

tab_bar_fix

Optional: Repeat the test with a bunch of pinned tabs

Definition of Done:


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@@ -703,7 +703,12 @@ extension TabBarViewController: TabCollectionViewModelDelegate {
updateEmptyTabArea()
hideTabPreview()
if tabMode == .overflow {
collectionView.scroll(to: IndexPath(item: index))
let isLastItem = collectionView.numberOfItems(inSection: 0) == index + 1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried a couple of different solutions and investigated why scroll(to: doesn't scroll to the item completely. Unfortunately, I haven't found a reason so decided to create this simple workaround to fix the most common problem

@tomasstrba tomasstrba requested review from a team, studiosutara and graeme and removed request for a team and studiosutara January 28, 2025 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants