You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Tabs] Ink bar is not correctly aligned on init #3048
changed the title [-]Misalignment of [md-ink-bar] element for Stretched Tabs on init app [/-][+][Tabs] Ink bar is not correctly aligned on init[/+]on Oct 19, 2017
This is happening to me, because my sidebar for the entire app has a width change on route change, so if I have a mat-tab-group in any page, I would have to implement this, which means, I would have to do this in over 10+ pages. This workaround is not a good fix for my use-case. Is there another fix, globally?
Reacted by Szymon Habrainski and Ramiro Jr. Franco
I also have ran into this issue. The mat-ink-bar does not recalculate when there is a material side nav with the mode set to "side". Here is my work around with css (I am hiding the mat-ink-bar and using &:after styling):
(add this to your global styles so it takes effect throughout your app)
So it does not work till now.
Workaround by @Anderman with ngAfterViewChecked() works but might cause performance problems.
In my case content loads, and causes a vertical scrollbar, it resizes the page a bit (but window.onresize doesn't catch this resize event, so can't catch it yet), and sets the wrong alignment to mat-ink. My workaround - listen for routing event, wait for content loading by setTimeout with 1sec delay and realign mat-ink. But it is awful :) wait for a better neat solution
This can be even worse if the control is not visible on init.
That ends up giving you width: 0px for the ink bar making it look like it just isn't working at all.
For some cases the following can be a temporary fix.
Activity
jarekskuder commentedon Jul 24, 2017
Same here on iOS 10.3.2 cordova app
[-]Misalignment of [md-ink-bar] element for Stretched Tabs on init app [/-][+][Tabs] Ink bar is not correctly aligned on init[/+]levz0r commentedon Feb 17, 2019
Hi,
Any plans to fix this?
Anderman commentedon Mar 15, 2019
Is there a workarond for this?
Anderman commentedon Mar 16, 2019
I have this workarond
bentaly commentedon Sep 30, 2019
This has changed to
_alignInkBarToSelectedTabin Angular 8dhair-seva commentedon Nov 2, 2019
This is happening to me, because my sidebar for the entire app has a width change on route change, so if I have a mat-tab-group in any page, I would have to implement this, which means, I would have to do this in over 10+ pages. This workaround is not a good fix for my use-case. Is there another fix, globally?
omaracrystal commentedon Sep 10, 2020
I also have ran into this issue. The mat-ink-bar does not recalculate when there is a material side nav with the mode set to "side". Here is my work around with css (I am hiding the mat-ink-bar and using &:after styling):
IgorKurkov commentedon Nov 23, 2020
So it does not work till now.
Workaround by @Anderman with
ngAfterViewChecked()works but might cause performance problems.In my case content loads, and causes a vertical scrollbar, it resizes the page a bit (but
window.onresizedoesn't catch this resize event, so can't catch it yet), and sets the wrong alignment to mat-ink. My workaround - listen for routing event, wait for content loading by setTimeout with 1sec delay and realign mat-ink. But it is awful :) wait for a better neat solutionsimeyla commentedon Sep 3, 2021
This can be even worse if the control is not visible on init.
That ends up giving you
width: 0pxfor the ink bar making it look like it just isn't working at all.For some cases the following can be a temporary fix.
Note: I'm using
mat-tab-nav-baras opposed tomat-tab-groupbut they use the same underlying ink bar.Melf11 commentedon Feb 11, 2022
the mat-ripple-element ist causing this issue. I don't know what the mat-ripple-element is doing exactly, but for me it's not necessary, so do:
or
angular-automatic-lock-bot commentedon Jun 18, 2022
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.