Skip to content

Commit

Permalink
fix: fix possible bug on event handler. (#36561)
Browse files Browse the repository at this point in the history
some browsers validate the empty object as `true`, so is safer to use an explicit check
  • Loading branch information
GeoSot authored Jun 14, 2022
1 parent 5f75413 commit ec8166a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/src/dom/event-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit ec8166a

Please sign in to comment.