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
[Tabs] Scroll by width of the first visible tab if only one tab is partially visible #32778
[Tabs] Scroll by width of the first visible tab if only one tab is partially visible #32778
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Based on https://codesandbox.io/s/scrollabletabsbuttonforce-material-demo-forked-bzqr8l?file=/package.json looks like the solution works. Let's add test to ensure we won't create another regression in the future.
@mnajdova Thanks for the review. The test I added in |
7afd991
to
1ba73e8
Compare
4aba1c4
to
91bfa8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better. Left few comments for simplifying the logic, and one thing that should be double checked. Good job with the tests!
91bfa8b
to
18db977
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a great first pull request on MUI 👌 Thank you for working on it!
Currently, you're not able to scroll tabs when the container is narrow enough to have only one tab (partially) visible. This is my proposed solution, which would scroll by the width of the first visible tab in such a case.
Fixes #32748