Skip to content

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

Closed
wants to merge 2 commits into from
Closed

fix:(tabs) add call for rechecking tab scroll distance #15173

wants to merge 2 commits into from

Conversation

lau32
Copy link

@lau32 lau32 commented Feb 13, 2019

Add call to scroll the tabs header after initialising header pagination, to accurately calculate the scroll distance.

Fixes #12889

Add call to scroll the tabs header after initialising header pagination, to accurately calculate the scroll distance.

Fixes #12889
@lau32 lau32 requested a review from andrewseguin as a code owner February 13, 2019 06:13
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 13, 2019
@@ -604,6 +604,26 @@ describe('MatTabHeader', () => {
expect(tabHeaderElement.classList).toContain(enabledClass);
});

it('scroll to last tab', () => {
Copy link
Member

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;
Copy link
Member

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)
Copy link
Member

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.

@mmalerba mmalerba added aaa and removed aaa labels Apr 25, 2019
@andrewseguin andrewseguin added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label May 30, 2019
@lau32
Copy link
Author

lau32 commented Jun 4, 2019

Hi, @andrewseguin sorry but I've forgotten all about this PR.
I've created a new PR here for this issue with the modifications suggested by Kristiyan, because I may have deleted the fork from my account and the repo name changed.

@mmalerba
Copy link
Contributor

mmalerba commented Mar 5, 2020

Closing this in favor of the new PR

@mmalerba mmalerba closed this Mar 5, 2020
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabs partially hidden by arrows
6 participants