Skip to content

Commit 5921859

Browse files
crisbetommalerba
authored andcommitted
fix(cdk/observers): incorrect coercion member type (#21116)
Fixes that the `ngAcceptInputType_debounce` was typed as a boolean input, even though it's a number. Fixes #21101. (cherry picked from commit 015ac3f)
1 parent 6830350 commit 5921859

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/cdk/observers/observe-content.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import {
1010
coerceBooleanProperty,
1111
coerceNumberProperty,
1212
coerceElement,
13-
BooleanInput
13+
BooleanInput,
14+
NumberInput
1415
} from '@angular/cdk/coercion';
1516
import {
1617
AfterContentInit,
@@ -194,13 +195,11 @@ export class CdkObserveContent implements AfterContentInit, OnDestroy {
194195
}
195196

196197
private _unsubscribe() {
197-
if (this._currentSubscription) {
198-
this._currentSubscription.unsubscribe();
199-
}
198+
this._currentSubscription?.unsubscribe();
200199
}
201200

202201
static ngAcceptInputType_disabled: BooleanInput;
203-
static ngAcceptInputType_debounce: BooleanInput;
202+
static ngAcceptInputType_debounce: NumberInput;
204203
}
205204

206205

tools/public_api_guard/cdk/observers.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export declare class CdkObserveContent implements AfterContentInit, OnDestroy {
77
constructor(_contentObserver: ContentObserver, _elementRef: ElementRef<HTMLElement>, _ngZone: NgZone);
88
ngAfterContentInit(): void;
99
ngOnDestroy(): void;
10-
static ngAcceptInputType_debounce: BooleanInput;
10+
static ngAcceptInputType_debounce: NumberInput;
1111
static ngAcceptInputType_disabled: BooleanInput;
1212
static ɵdir: i0.ɵɵDirectiveDefWithMeta<CdkObserveContent, "[cdkObserveContent]", ["cdkObserveContent"], { "disabled": "cdkObserveContentDisabled"; "debounce": "debounce"; }, { "event": "cdkObserveContent"; }, never>;
1313
static ɵfac: i0.ɵɵFactoryDef<CdkObserveContent, never>;

0 commit comments

Comments
 (0)