-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dialog): allow for single dialog scroll strategy to be overwritten #8726
Conversation
Currently we have the `MAT_DIALOG_SCROLL_STRATEGY` token which allows consumers to specify the scroll strategy for all dialogs, however there's no way do so for a single dialog. These changes add an extra property to the dialog config that allow for the scroll strategy to be set. Fixes angular#8706.
29be96f
to
f0720e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@crisbeto You mention that MAT_DIALOG_SCROLL_STRATEGY can be set by the consumer. I've been trying to figure out how to do it. Can you shed any light on how to override it with a different scroll strategy... even if it is global. |
You need to do something like this in your module @jpduckwo: @NgModule({
...
providers: [
{
provide: MAT_DIALOG_SCROLL_STRATEGY,
deps: [Overlay],
useFactory: (overlay: Overlay) => () => overlay.scrollStrategies.close()
}
]
}) |
…en (#8726) Currently we have the `MAT_DIALOG_SCROLL_STRATEGY` token which allows consumers to specify the scroll strategy for all dialogs, however there's no way do so for a single dialog. These changes add an extra property to the dialog config that allow for the scroll strategy to be set. Fixes #8706.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently we have the
MAT_DIALOG_SCROLL_STRATEGY
token which allows consumers to specify the scroll strategy for all dialogs, however there's no way do so for a single dialog. These changes add an extra property to the dialog config that allow for the scroll strategy to be set.Fixes #8706.