-
Notifications
You must be signed in to change notification settings - Fork 160
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
feat: Tabs scroll snapping #3143
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3143 +/- ##
=======================================
Coverage 96.40% 96.40%
=======================================
Files 784 784
Lines 22130 22130
Branches 7528 7586 +58
=======================================
Hits 21335 21335
- Misses 743 788 +45
+ Partials 52 7 -45 ☔ View full report in Codecov by Sentry. |
…dth to make its center position to be aligned with a center of the container
@@ -223,13 +223,25 @@ test( | |||
await page.setWindowSize({ width: 500, height: 1000 }); | |||
await page.click('#add-tab'); | |||
await page.click(page.paginationButton('right', true)); | |||
await page.click(page.paginationButton('right', true)); |
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.
Why is it necessary to click once more in the right arrow now? Actually, it looks like the component scrolls a bit further now than before, making the seventh tab visible with one single click whereas before it wasn't.
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.
The component actually scrolls slightly less than before, which is why this condition is necessary
Description
Reintroduced tabs scroll snapping reverted in this commit.
The main issue with the previous implementation was that the custom scrollIntoView could scroll in a way that pushed the active element out of view.
This PR adjusts the scrollIntoView logic to always center the active element in the container, which should fix the problem.
Related links, issue #, if available: n/a
How has this been tested?
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.