Skip to content
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
1 change: 0 additions & 1 deletion src/cdk/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ ts_project(
":overlay",
"//:node_modules/@angular/common",
"//:node_modules/@angular/core",
"//:node_modules/@angular/platform-browser",
"//:node_modules/rxjs",
"//src/cdk/bidi",
"//src/cdk/keycodes",
Expand Down
3 changes: 1 addition & 2 deletions src/cdk/overlay/overlay-directives.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Component, ElementRef, Injector, signal, ViewChild, WritableSignal} from '@angular/core';
import {ComponentFixture, fakeAsync, TestBed, tick, waitForAsync} from '@angular/core/testing';
import {By} from '@angular/platform-browser';
import {Subject} from 'rxjs';
import {Direction} from '../bidi';
import {A, ESCAPE} from '../keycodes';
Expand Down Expand Up @@ -381,7 +380,7 @@ describe('Overlay directives', () => {
});

it('should set the offsetY', () => {
const trigger = fixture.debugElement.query(By.css('button'))!.nativeElement;
const trigger = fixture.nativeElement.querySelector('button');
trigger.style.position = 'absolute';
trigger.style.top = '30px';
trigger.style.height = '20px';
Expand Down
15 changes: 10 additions & 5 deletions src/cdk/overlay/overlay.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import {Location} from '@angular/common';
import {SpyLocation} from '@angular/common/testing';
import {
ANIMATION_MODULE_TYPE,
Component,
ErrorHandler,
EventEmitter,
Injectable,
Injector,
Type,
Provider,
ViewChild,
ViewContainerRef,
WritableSignal,
Expand All @@ -21,7 +22,6 @@ import {
tick,
waitForAsync,
} from '@angular/core/testing';
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
import {Direction, Directionality} from '../bidi';
import {CdkPortal, ComponentPortal, TemplatePortal} from '../portal';
import {dispatchFakeEvent} from '../testing/private';
Expand All @@ -47,16 +47,16 @@ describe('Overlay', () => {
let dir: WritableSignal<Direction>;
let mockLocation: SpyLocation;

function setup(imports: Type<unknown>[] = []) {
function setup(providers: Provider[] = []) {
dir = signal<Direction>('ltr');
TestBed.configureTestingModule({
imports,
providers: [
provideFakeDirectionality(dir),
{
provide: Location,
useClass: SpyLocation,
},
...providers,
],
});

Expand Down Expand Up @@ -892,7 +892,12 @@ describe('Overlay', () => {
it('should set a class on the backdrop when animations are disabled', () => {
cleanup();
TestBed.resetTestingModule();
setup([NoopAnimationsModule]);
setup([
{
provide: ANIMATION_MODULE_TYPE,
useValue: 'NoopAnimations',
},
]);

let overlayRef = createOverlayRef(injector, config);
overlayRef.attach(componentPortal);
Expand Down
2 changes: 1 addition & 1 deletion src/material/button-toggle/button-toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ export class MatButtonToggle implements OnInit, AfterViewInit, OnDestroy {
// This serves two purposes:
// 1. We don't want the animation to fire on the first render for pre-checked toggles so we
// delay adding the class until the view is rendered.
// 2. We don't want animation if the `NoopAnimationsModule` is provided.
// 2. We don't want to animate if animations are disabled.
if (!this._animationDisabled) {
this._elementRef.nativeElement.classList.add('mat-button-toggle-animations-enabled');
}
Expand Down
2 changes: 1 addition & 1 deletion src/material/core/ripple/ripple.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const globalRippleConfig: RippleGlobalOptions = {
};
```

**Note**: Ripples will also have no animation if the `NoopAnimationsModule` is being used. This
**Note**: Ripples will also have no animation if animations are disabled globally. This
also means that the durations in the `animation` configuration won't be taken into account.

### Animation behavior
Expand Down
6 changes: 3 additions & 3 deletions src/material/core/ripple/ripple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface RippleGlobalOptions {
/**
* Default configuration for the animation duration of the ripples. There are two phases with
* different durations for the ripples: `enter` and `leave`. The durations will be overwritten
* by the value of `matRippleAnimation` or if the `NoopAnimationsModule` is included.
* by the value of `matRippleAnimation` or if animations are disabled.
*/
animation?: RippleAnimationConfig;

Expand Down Expand Up @@ -88,8 +88,8 @@ export class MatRipple implements OnInit, OnDestroy, RippleTarget {

/**
* Configuration for the ripple animation. Allows modifying the enter and exit animation
* duration of the ripples. The animation durations will be overwritten if the
* `NoopAnimationsModule` is being used.
* duration of the ripples. The animation durations will be overwritten if animations are
* disabled.
*/
@Input('matRippleAnimation') animation: RippleAnimationConfig;

Expand Down
1 change: 0 additions & 1 deletion src/material/expansion/expansion-panel-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ $fallbacks: m3-expansion.get-tokens();
}
}

// If the `NoopAnimationsModule` is used, disable the height transition.
&._mat-animation-noopable {
transition: none;
}
Expand Down
4 changes: 2 additions & 2 deletions src/material/progress-spinner/progress-spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export interface MatProgressSpinnerDefaultOptions {
/** Width of the spinner's stroke. */
strokeWidth?: number;
/**
* Whether the animations should be force to be enabled, ignoring if the current environment is
* using NoopAnimationsModule.
* Whether the animations should be force to be enabled, ignoring if the current environment
* disables them.
*/
_forceAnimations?: boolean;
}
Expand Down
1 change: 0 additions & 1 deletion src/material/sidenav/drawer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ $fallbacks: m3-sidenav.get-tokens();
z-index: $drawer-backdrop-z-index;
}

// Note that the `NoopAnimationsModule` is being handled inside of the component code.
&.ng-animate-disabled,
.ng-animate-disabled & {
.mat-drawer-backdrop,
Expand Down
Loading