From 76e945bbbd538fc182345de7c47fe916deb56f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 13 Oct 2024 21:23:57 +0200 Subject: [PATCH] Fixed issue that the document could not be scrolled anymore, when redirected from a modal This fixes issue #696 --- assets/js/register_events.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/assets/js/register_events.js b/assets/js/register_events.js index 5d2aece0..9732c0c1 100644 --- a/assets/js/register_events.js +++ b/assets/js/register_events.js @@ -21,6 +21,7 @@ import {Dropdown} from "bootstrap"; import ClipboardJS from "clipboard"; +import {Modal} from "bootstrap"; class RegisterEventHelper { constructor() { @@ -31,9 +32,11 @@ class RegisterEventHelper { //Initialize ClipboardJS this.registerLoadHandler(() => { new ClipboardJS('.btn'); - }) + }); this.registerModalDropRemovalOnFormSubmit(); + + } registerModalDropRemovalOnFormSubmit() { @@ -43,6 +46,15 @@ class RegisterEventHelper { if (back_drop) { back_drop.remove(); } + + //Remove scroll-lock if it is still active + if (document.body.classList.contains('modal-open')) { + document.body.classList.remove('modal-open'); + + //Remove the padding-right and overflow:hidden from the body + document.body.style.paddingRight = ''; + document.body.style.overflow = ''; + } }); }