Prevent scrolling of the page when modals are displayed (#5816)

* prevent scroll-chaining in modals

* make body overflow hidden to prevent background scrolling
This commit is contained in:
Mario Pietsch
2021-06-27 16:24:06 +01:00
committed by GitHub
parent c9af04d0e5
commit a409536ad0
3 changed files with 5 additions and 1 deletions
+1
View File
@@ -243,6 +243,7 @@ Modal.prototype.adjustPageClass = function() {
if(windowContainer) {
$tw.utils.toggleClass(windowContainer,"tc-modal-displayed",this.modalCount > 0);
}
$tw.utils.toggleClass(this.srcDocument.body,"tc-modal-prevent-scroll",this.modalCount > 0);
};
exports.Modal = Modal;