Skip to content

Commit

Permalink
fix(esl-event-listener): fix target delegation checking
Browse files Browse the repository at this point in the history
  • Loading branch information
NastaLeo committed Mar 29, 2023
1 parent 4d24896 commit b307ce6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/esl-event-listener/core/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class ESLEventListener implements ESLListenerDefinition, EventListenerObj
const current = e.currentTarget;
const delegate = this.delegate;
if (typeof delegate !== 'string') return true;
if (!delegate || !(target instanceof HTMLElement) || !(current instanceof HTMLElement)) return false;
if (!delegate || !(target instanceof Element) || !(current instanceof Element)) return false;
return current.contains(target.closest(delegate));
}

Expand Down

0 comments on commit b307ce6

Please # to comment.