Skip to content

Commit 88a0520

Browse files
committed
refactor(material/autocomplete): Injects Breakpoint to fix breaking tests
Fixes broken presubmit tests for Angular Component's Autocomplete constructor by injecting BreakpointObserver rather than adding to the constructor. Fixes b/247881646
1 parent 869dfb3 commit 88a0520

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/material/autocomplete/autocomplete-trigger.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ export class MatAutocompleteTrigger
239239
private _viewContainerRef: ViewContainerRef,
240240
private _zone: NgZone,
241241
private _changeDetectorRef: ChangeDetectorRef,
242-
private _breakpointObserver: BreakpointObserver,
243242
@Inject(MAT_AUTOCOMPLETE_SCROLL_STRATEGY) scrollStrategy: any,
244243
@Optional() private _dir: Directionality | null,
245244
@Optional() @Inject(MAT_FORM_FIELD) @Host() private _formField: MatFormField | null,
@@ -881,6 +880,9 @@ export class MatAutocompleteTrigger
881880
});
882881
}
883882

883+
/** Implements BreakpointObserver to be used to detect handset landscape */
884+
private _breakpointObserver = inject(BreakpointObserver);
885+
884886
private _getOverlayPosition(): PositionStrategy {
885887
// Set default Overlay Position
886888
const strategy = this._overlay

0 commit comments

Comments
 (0)