From 4c2dbeecd7bafa5e55893c939c800edc9eb5f4a7 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 4 Jun 2025 16:43:24 +0200 Subject: info modal: Workaround for boostrap bug #41005. Bug: https://github.com/twbs/bootstrap/issues/41005#issuecomment-2585390544 --- main.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.js b/main.js index b1d6e0b..6808456 100644 --- a/main.js +++ b/main.js @@ -472,6 +472,13 @@ if (window.location === window.parent.location) { btn.setAttribute('aria-expanded', 'true'); btn.classList.replace('btn-light', 'btn-dark'); }); + panel.addEventListener('hide.bs.modal', function() { + /* XXX workaround for https://github.com/twbs/bootstrap/issues/41005#issuecomment-2585390544 */ + const activeElement = document.activeElement; + if (activeElement instanceof HTMLElement) { + activeElement.blur(); + } + }); panel.addEventListener('hidden.bs.modal', function() { btn.classList.replace('btn-dark', 'btn-light'); btn.setAttribute('aria-expanded', 'false'); -- cgit v1.2.3