Skip to content

Commit

Permalink
* modal: add disableScroll selector.
Browse files Browse the repository at this point in the history
  • Loading branch information
YonLJ committed Feb 29, 2024
1 parent 967caf8 commit c7b9891
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/modal/src/vanilla/modal-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ export class ModalBase<T extends ModalBaseOptions = ModalBaseOptions> extends Co

this.on('hidden', () => {
if (!ModalBase.getAll().some((modal) => modal.shown)) {
$('html').enableScroll();
$('html,body').enableScroll();
}
});
this.on('show', () => {
$('html').disableScroll();
$('html,body').disableScroll();
});
if (this.shown) {
$('html').disableScroll();
$('html,body').disableScroll();
}
}

Expand Down

0 comments on commit c7b9891

Please sign in to comment.