Skip to content

Commit f58576f

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 1e4df06 commit f58576f

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
@@ -240,7 +240,6 @@ export class MatAutocompleteTrigger
240240
private _viewContainerRef: ViewContainerRef,
241241
private _zone: NgZone,
242242
private _changeDetectorRef: ChangeDetectorRef,
243-
private _breakpointObserver: BreakpointObserver,
244243
@Inject(MAT_AUTOCOMPLETE_SCROLL_STRATEGY) scrollStrategy: any,
245244
@Optional() private _dir: Directionality | null,
246245
@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)