Created
November 13, 2020 05:58
-
-
Save twobiers/c0c50e714523b1542c487ead3d57bb45 to your computer and use it in GitHub Desktop.
CloseScrollStrategy on MatAutocomplete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule } from '@angular/core'; | |
import { MAT_AUTOCOMPLETE_SCROLL_STRATEGY } from '@angular/material'; | |
import { Overlay, ScrollStrategy } from '@angular/cdk/overlay'; | |
@NgModule({ | |
declarations: [ | |
[..] | |
], | |
providers: [{ provide: MAT_AUTOCOMPLETE_SCROLL_STRATEGY, useFactory: function (overlay: Overlay): () => ScrollStrategy { | |
return () => overlay.scrollStrategies.close(); | |
}, deps: [Overlay]}] | |
}) | |
export class AppModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment