From ec8166a90fcf914372a91646581fbe793ad22cc5 Mon Sep 17 00:00:00 2001 From: GeoSot Date: Tue, 14 Jun 2022 08:33:53 +0300 Subject: [PATCH] fix: fix possible bug on event handler. (#36561) some browsers validate the empty object as `true`, so is safer to use an explicit check --- js/src/dom/event-handler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/dom/event-handler.js b/js/src/dom/event-handler.js index 8bed9b39bb79..87f936b41d44 100644 --- a/js/src/dom/event-handler.js +++ b/js/src/dom/event-handler.js @@ -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 }