aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2025-06-04 16:43:24 +0200
committerGuilhem Moulin <guilhem@fripost.org>2025-06-04 16:49:58 +0200
commit4c2dbeecd7bafa5e55893c939c800edc9eb5f4a7 (patch)
tree667d31a58ab7e4d05f918623bd434f07e7ea49cc
parent79856bdc0910b39a96e0cb2c7ae2d75fee4866bb (diff)
info modal: Workaround for boostrap bug #41005.
Bug: https://github.com/twbs/bootstrap/issues/41005#issuecomment-2585390544
-rw-r--r--main.js7
1 files changed, 7 insertions, 0 deletions
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');