Mohammad Dayyan
Mohammad Dayyan

Reputation: 22408

Angular Materials 6.3.0 Dialog is not center align after update?

I've used angular Dialog with 6.2.1 materials version, it was OK.

I just updated to 6.3.0.
Now All of my Dialogs are right align, not center !

Angular Material dialog

What's wrong !

Update:

I found what causes this problem. Whenever I set dir="rtl" in html tag, problem occurred. How can I fix it?

Upvotes: 1

Views: 4713

Answers (1)

Mohammad Dayyan
Mohammad Dayyan

Reputation: 22408

I found the solution. We can resolve this problem as follows:

from https://material.angular.io/components/dialog/overview#specifying-global-configuration-defaults

Specifying global configuration defaults Default dialog options can be specified by providing an instance of MatDialogConfig for MAT_DIALOG_DEFAULT_OPTIONS in your application's root module.

@NgModule({
  providers: [
    {provide: MAT_DIALOG_DEFAULT_OPTIONS, useValue: {hasBackdrop: true, direction: 'ltr'}}
  ]
})

Notice to direction: 'ltr'

Upvotes: 4

Related Questions