]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
fix: fix possible bug on event handler. (#36561)
authorGeoSot <geo.sotis@gmail.com>
Tue, 14 Jun 2022 05:33:53 +0000 (08:33 +0300)
committerGitHub <noreply@github.com>
Tue, 14 Jun 2022 05:33:53 +0000 (08:33 +0300)
some browsers validate the empty object as `true`, so is safer to use an explicit check

js/src/dom/event-handler.js

index 8bed9b39bb793f652ccc4c447f52a0c1c086c798..87f936b41d44cd09f613f0400edf8d3e35abe009 100644 (file)
@@ -234,7 +234,7 @@ const EventHandler = {
 
     if (typeof callable !== 'undefined') {
       // Simplest case: handler is passed, remove that listener ONLY.
-      if (!storeElementEvent) {
+      if (!Object.keys(storeElementEvent).length) {
         return
       }