Skip to content
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

fix(material/tabs): remove visibility style when hydrating #29220

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/material/tabs/tab-group.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ describe('MDC-based MatTabGroup', () => {
);

expect(contentElements.map(element => element.style.visibility)).toEqual([
'',
'visible',
'hidden',
'hidden',
'hidden',
Expand All @@ -805,7 +805,7 @@ describe('MDC-based MatTabGroup', () => {
expect(contentElements.map(element => element.style.visibility)).toEqual([
'hidden',
'hidden',
'',
'visible',
'hidden',
]);

Expand All @@ -815,7 +815,7 @@ describe('MDC-based MatTabGroup', () => {

expect(contentElements.map(element => element.style.visibility)).toEqual([
'hidden',
'',
'visible',
'hidden',
'hidden',
]);
Expand Down
7 changes: 5 additions & 2 deletions src/material/tabs/tabs-animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
* found in the LICENSE file at https://angular.io/license
*/
import {
AnimationTriggerMetadata,
animate,
state,
style,
transition,
trigger,
AnimationTriggerMetadata,
} from '@angular/animations';

/**
Expand All @@ -24,7 +24,10 @@ export const matTabsAnimations: {
/** Animation translates a tab along the X axis. */
translateTab: trigger('translateTab', [
// Transitions to `none` instead of 0, because some browsers might blur the content.
state('center, void, left-origin-center, right-origin-center', style({transform: 'none'})),
state(
'center, void, left-origin-center, right-origin-center',
style({transform: 'none', visibility: 'visible'}),
),

// If the tab is either on the left or right, we additionally add a `min-height` of 1px
// in order to ensure that the element has a height before its state changes. This is
Expand Down
Loading