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/dialog): scale animation not working #28449

Merged
merged 1 commit into from
Jan 18, 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/dev-app/dialog/dialog-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,24 +195,24 @@ export class JazzDialog {
`
img {
max-width: 100%;
height: 800px;
}
`,
],
template: `
<h2 mat-dialog-title>Neptune</h2>

<mat-dialog-content>
<img src="https://upload.wikimedia.org/wikipedia/commons/5/56/Neptune_Full.jpg"/>

<p>
Neptune is the eighth and farthest known planet from the Sun in the Solar System. In the
Solar System, it is the fourth-largest planet by diameter, the third-most-massive planet,
and the densest giant planet. Neptune is 17 times the mass of Earth and is slightly more
massive than its near-twin Uranus, which is 15 times the mass of Earth and slightly larger
than Neptune. Neptune orbits the Sun once every 164.8 years at an average distance of 30.1
astronomical units (4.50×109 km). It is named after the Roman god of the sea and has the
astronomical units (4.50x109 km). It is named after the Roman god of the sea and has the
astronomical symbol ♆, a stylised version of the god Neptune's trident.
</p>
<img src="https://upload.wikimedia.org/wikipedia/commons/5/56/Neptune_Full.jpg"/>
</mat-dialog-content>

<mat-dialog-actions [align]="actionsAlignment">
Expand Down
13 changes: 10 additions & 3 deletions src/material/dialog/dialog.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use '@material/dialog' as mdc-dialog;
@use '@material/animation/animation' as mdc-animation;
@use '@material/dialog/dialog-theme' as mdc-dialog-theme;
@use '../core/tokens/m2/mdc/dialog' as tokens-mdc-dialog;
@use '../core/mdc-helpers/mdc-helpers';
Expand Down Expand Up @@ -33,14 +34,20 @@ $mat-dialog-button-horizontal-margin: 8px !default;
outline: 0;

.mdc-dialog__container {
transition-duration: var(--mat-dialog-transition-duration, 0ms);
transition: opacity linear var(--mat-dialog-transition-duration, 0ms);
}

.mdc-dialog__surface {
transition: mdc-animation.enter(transform, var(--mat-dialog-transition-duration, 0ms));
}

// Angular Material supports disabling all animations when NoopAnimationsModule is imported.
// TODO(devversion): Look into using MDC's Sass queries to separate the animation styles and
// conditionally add them. Consider the size cost and churn when deciding whether to switch.
&._mat-animation-noopable .mdc-dialog__container {
transition: none;
&._mat-animation-noopable {
.mdc-dialog__container, .mdc-dialog__surface {
transition: none;
}
}
}
}
Expand Down
Loading