Skip to content

Commit

Permalink
fix(dialog)!: fix exception when opening when compiled with advanced …
Browse files Browse the repository at this point in the history
…closure settings

PiperOrigin-RevId: 511523151
  • Loading branch information
material-web-copybara authored and copybara-github committed Feb 22, 2023
1 parent 1f7e538 commit c63a1d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dialog/lib/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,7 @@ export class Dialog extends LitElement {
// prevent body scrolling early only when opening to avoid layout
// shift when closing.
if (!this.modeless && this.open) {
(this.constructor as typeof Dialog)
.setDocumentScrollingDisabled(this.open);
Dialog.setDocumentScrollingDisabled(this.open);
}
if (this.open) {
this.contentElement.scrollTop = 0;
Expand Down Expand Up @@ -410,8 +409,7 @@ export class Dialog extends LitElement {
await closedPromise;
// enable scrolling late to avoid layout shift when closing
if (!this.modeless) {
(this.constructor as typeof Dialog)
.setDocumentScrollingDisabled(this.open);
Dialog.setDocumentScrollingDisabled(this.open);
}
}
// Focus initial element.
Expand Down

0 comments on commit c63a1d9

Please sign in to comment.