From 405226d66cd090466a10f1c455772dda7ac38339 Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Fri, 28 Aug 2026 19:34:41 +0530 Subject: [PATCH] fix(header): append hmsAppsLauncherModal to document.body to fix modal backdrop overlay issue --- app/Views/partials/header.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/Views/partials/header.php b/app/Views/partials/header.php index d968eed..a37a8ea 100644 --- a/app/Views/partials/header.php +++ b/app/Views/partials/header.php @@ -391,6 +391,20 @@ } } + function showAppsModal() { + var modalEl = document.getElementById('hmsAppsLauncherModal'); + if (modalEl) { + if (modalEl.parentElement !== document.body) { + document.body.appendChild(modalEl); + } + if (window.bootstrap && window.bootstrap.Modal) { + window.bootstrap.Modal.getOrCreateInstance(modalEl).show(); + } else if (typeof $ !== 'undefined' && $.fn && $.fn.modal) { + $(modalEl).modal('show'); + } + } + } + function openAppsModal() { var apiUrl = ''; fetch(apiUrl) @@ -409,25 +423,11 @@ } } updateHdrAppDetails(); - var modalEl = document.getElementById('hmsAppsLauncherModal'); - if (modalEl) { - if (window.bootstrap && window.bootstrap.Modal) { - window.bootstrap.Modal.getOrCreateInstance(modalEl).show(); - } else if (typeof $ !== 'undefined' && $.fn && $.fn.modal) { - $(modalEl).modal('show'); - } - } + showAppsModal(); }) .catch(function(err) { updateHdrAppDetails(); - var modalEl = document.getElementById('hmsAppsLauncherModal'); - if (modalEl) { - if (window.bootstrap && window.bootstrap.Modal) { - window.bootstrap.Modal.getOrCreateInstance(modalEl).show(); - } else if (typeof $ !== 'undefined' && $.fn && $.fn.modal) { - $(modalEl).modal('show'); - } - } + showAppsModal(); }); }