Skip to content

Commit

Permalink
fix(dialog): Dialog scroll-lock fix when calling destroy immediately …
Browse files Browse the repository at this point in the history
…after close (#2120)

Prevents the case where the body remained scroll locked when calling destroy immediately after close.
  • Loading branch information
tompng authored and williamernest committed May 15, 2018
1 parent e5ad26a commit c961a5d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/mdc-dialog/foundation.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default class MDCDialogFoundation extends MDCFoundation {

close() {
this.isOpen_ = false;
this.enableScroll_();
this.adapter_.deregisterSurfaceInteractionHandler('click', this.dialogClickHandler_);
this.adapter_.deregisterDocumentKeydownHandler(this.documentKeydownHandler_);
this.adapter_.deregisterInteractionHandler('click', this.componentClickHandler_);
Expand Down Expand Up @@ -137,8 +138,6 @@ export default class MDCDialogFoundation extends MDCFoundation {
this.adapter_.removeClass(MDCDialogFoundation.cssClasses.ANIMATING);
if (this.isOpen_) {
this.adapter_.trapFocusOnSurface();
} else {
this.enableScroll_();
};
};
};
Expand Down

0 comments on commit c961a5d

Please sign in to comment.