-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix:(tabs) add call for rechecking tab scroll distance #15173
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
Conversation
Add call to scroll the tabs header after initialising header pagination, to accurately calculate the scroll distance. Fixes #12889
…2889(tabs)_tabs_hidden_by_arrows
@@ -604,6 +604,26 @@ describe('MatTabHeader', () => { | |||
expect(tabHeaderElement.classList).toContain(enabledClass); | |||
}); | |||
|
|||
it('scroll to last tab', () => { |
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.
nit: we usually start test names with "should".
{label: 'tab seven'}, | ||
{label: 'tab eight'}, | ||
]; | ||
appComponent.tabHeader.selectedIndex = 8; |
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.
Shouldn't this be 7? Index 8 is out of bounds of the array.
|
||
fixture.componentRef.changeDetectorRef.markForCheck(); | ||
|
||
expect(appComponent.tabHeader.scrollDistance) |
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.
I'm not sure that this test is verifying the correct thing. I tried pasting it into master without the fix from this PR and it still passes. This somewhat defeats the purpose of the test, because we won't know if we accidentally introduce a regression.
Hi, @andrewseguin sorry but I've forgotten all about this PR. |
Closing this in favor of the new PR |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Add call to scroll the tabs header after initialising header pagination, to accurately calculate the scroll distance.
Fixes #12889