diff --git a/public/assets/js/app.js b/public/assets/js/app.js
index 8daf231fe4edc95d7d535f93f74be399ed82a9ed..7f8e93d6d7241c2f18bbab1aad4569d7bb4d547f 100755
--- a/public/assets/js/app.js
+++ b/public/assets/js/app.js
@@ -15,19 +15,10 @@ $(function() {
         });
     });
 
-    // Bug rencontré par Mathieu sous firefox Linux (mais pas Chrome), plusieurs overlay sont ouverts, on supprime ceux en trop
-    document.addEventListener('show.bs.modal', function () {
-        // Select all modal-backdrop elements
-        const backdrops = document.querySelectorAll('.modal-backdrop');
-
-        // If there are more than one, remove all except the first one
-        if (backdrops.length > 1) {
-            backdrops.forEach((backdrop, index) => {
-                if (index > 0) {
-                    backdrop.remove();
-                }
-            });
-        }
+    // Bug rencontré par Mathieu sous firefox Linux (mais pas Chrome), plusieurs overlay sont ouverts, on les supprime tous à la fermeture d'une modal
+    document.addEventListener('hidden.bs.modal', function () {
+        // Remove leftover modal-backdrop elements
+        document.querySelectorAll('.modal-backdrop').forEach((backdrop) => backdrop.remove());
     });