-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
perf(tabs): use a transform to resize and move the ink bar #10664
Conversation
src/lib/tabs/ink-bar.ts
Outdated
|
||
/** | ||
* Interface for a a MatInkBar positioner method, defining the positioning and width of the ink | ||
* bar in a set of tabs. | ||
* @deprecated Signature to be changed to `{left: number, width: number}`. |
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.
Since this is internal, we can just change the signature now. No need to go through the @deprecated
path
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.
That's fine by me, but I thought the intention with #9972 was to make this logic public.
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.
At this point its still internal to the library, though we might make it public later. But since it's still internal at this point, we can just switch it over.
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.
Cool, done.
7d65167
to
d141faf
Compare
d141faf
to
7e25889
Compare
The current tab indicator (colored line under the tab) disappeared in screenshot tests. |
When the tabs are first rendered, the ink bar transitions into place. I believe this is a regression Old behavior: https://stackblitz.com/edit/angular-32czww?file=app/tabs-overview-example.ts The ink bar is immediately present on first render and only translates when changed. With this PR, open the demo app and load the tabs page. All the ink bars transition into place on first render. This is the reason why we are seeing screenshot errors I believe, because the ink bar is 1px wide as if its about to render. |
7e25889
to
9829b80
Compare
Uses a transform, rather than `left` and `width` to move/resize the ink bar in order to ensure a smoother transition.
9829b80
to
63b6fd9
Compare
@andrewseguin @tinayuangao I've reworked it to prevent it from animating in on the initial load. Marking as merge ready to see if it still breaks anything. |
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. |
Uses a transform, rather than
left
andwidth
to move/resize the ink bar in order to ensure a smoother transition.