Skip to content

Commit b56bcad

Browse files
devversionmmalerba
authored andcommitted
refactor: allow coercion inputs to work with async pipe (#17640)
We need to accept `null` and `undefined` for coercion members to make them work with the `async` pipe. The overall problem remains for other non-coercion inputs, but since the majority of inputs are coerced, we only make the change to these. The overall problem applies to _all_ inputs, but it's not clear yet how this issue can be solved for all inputs. This involves discussion with the framework team. More information: https://hackmd.io/@devversion/rkKOD8ZjB
1 parent a5cad10 commit b56bcad

File tree

136 files changed

+553
-502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+553
-502
lines changed

src/cdk-experimental/scrolling/auto-size-virtual-scroll.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,6 @@ export class CdkAutoSizeVirtualScroll implements OnChanges {
464464
this._scrollStrategy.updateBufferSize(this.minBufferPx, this.maxBufferPx);
465465
}
466466

467-
static ngAcceptInputType_minBufferPx: number | string;
468-
static ngAcceptInputType_maxBufferPx: number | string;
467+
static ngAcceptInputType_minBufferPx: number | string | null | undefined;
468+
static ngAcceptInputType_maxBufferPx: number | string | null | undefined;
469469
}

src/cdk/a11y/focus-trap/focus-trap.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,6 @@ export class CdkTrapFocus implements OnDestroy, AfterContentInit, DoCheck {
419419
}
420420
}
421421

422-
static ngAcceptInputType_enabled: boolean | string;
423-
static ngAcceptInputType_autoCapture: boolean | string;
422+
static ngAcceptInputType_enabled: boolean | string | null | undefined;
423+
static ngAcceptInputType_autoCapture: boolean | string | null | undefined;
424424
}

src/cdk/accordion/accordion-item.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,6 @@ export class CdkAccordionItem implements OnDestroy {
153153
});
154154
}
155155

156-
static ngAcceptInputType_expanded: boolean | string;
157-
static ngAcceptInputType_disabled: boolean | string;
156+
static ngAcceptInputType_expanded: boolean | string | null | undefined;
157+
static ngAcceptInputType_disabled: boolean | string | null | undefined;
158158
}

src/cdk/accordion/accordion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ export class CdkAccordion implements OnDestroy, OnChanges {
6060
}
6161
}
6262

63-
static ngAcceptInputType_multi: boolean | string;
63+
static ngAcceptInputType_multi: boolean | string | null | undefined;
6464
}

src/cdk/drag-drop/directives/drag-handle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ export class CdkDragHandle implements OnDestroy {
4747
this._stateChanges.complete();
4848
}
4949

50-
static ngAcceptInputType_disabled: boolean | string;
50+
static ngAcceptInputType_disabled: boolean | string | null | undefined;
5151
}

src/cdk/drag-drop/directives/drag.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ export class CdkDrag<T = any> implements AfterViewInit, OnChanges, OnDestroy {
409409
});
410410
}
411411

412-
static ngAcceptInputType_disabled: boolean | string;
412+
static ngAcceptInputType_disabled: boolean | string | null | undefined;
413413
}
414414

415415
/** Gets the closest ancestor of an element that matches a selector. */

src/cdk/drag-drop/directives/drop-list-group.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ export class CdkDropListGroup<T> implements OnDestroy {
3535
this._items.clear();
3636
}
3737

38-
static ngAcceptInputType_disabled: boolean | string;
38+
static ngAcceptInputType_disabled: boolean | string | null | undefined;
3939
}

src/cdk/drag-drop/directives/drop-list.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ export class CdkDropList<T = any> implements AfterContentInit, OnDestroy {
328328
});
329329
}
330330

331-
static ngAcceptInputType_disabled: boolean | string;
332-
static ngAcceptInputType_sortingDisabled: boolean | string;
333-
static ngAcceptInputType_autoScrollDisabled: boolean | string;
331+
static ngAcceptInputType_disabled: boolean | string | null | undefined;
332+
static ngAcceptInputType_sortingDisabled: boolean | string | null | undefined;
333+
static ngAcceptInputType_autoScrollDisabled: boolean | string | null | undefined;
334334
}

src/cdk/observers/observe-content.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ export class CdkObserveContent implements AfterContentInit, OnDestroy {
194194
}
195195
}
196196

197-
static ngAcceptInputType_disabled: boolean | string;
198-
static ngAcceptInputType_debounce: boolean | string;
197+
static ngAcceptInputType_disabled: boolean | string | null | undefined;
198+
static ngAcceptInputType_debounce: boolean | string | null | undefined;
199199
}
200200

201201

src/cdk/overlay/overlay-directives.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,11 @@ export class CdkConnectedOverlay implements OnDestroy, OnChanges {
384384
this._backdropSubscription.unsubscribe();
385385
}
386386

387-
static ngAcceptInputType_hasBackdrop: boolean | string;
388-
static ngAcceptInputType_lockPosition: boolean | string;
389-
static ngAcceptInputType_flexibleDimensions: boolean | string;
390-
static ngAcceptInputType_growAfterOpen: boolean | string;
391-
static ngAcceptInputType_push: boolean | string;
387+
static ngAcceptInputType_hasBackdrop: boolean | string | null | undefined;
388+
static ngAcceptInputType_lockPosition: boolean | string | null | undefined;
389+
static ngAcceptInputType_flexibleDimensions: boolean | string | null | undefined;
390+
static ngAcceptInputType_growAfterOpen: boolean | string | null | undefined;
391+
static ngAcceptInputType_push: boolean | string | null | undefined;
392392
}
393393

394394

0 commit comments

Comments
 (0)