exadel-inc / esl

Lightweight and flexible UI component library based on web components technology for creating basic UX modules
https://esl-ui.com
MIT License
57 stars 9 forks source link

[🐛 esl-event-listener]: incorrect delegation handling / $delegate is possibly null while selector is defined #2259

Closed ala-n closed 5 months ago

ala-n commented 5 months ago

To Reproduce Steps to reproduce the behavior:

  1. Add event listener:
    ESL.EventUtils.subscribe(document, {
      event: 'click',
      target: document,
      selector: 'a[href*="?"]'
    }, (e) => console.log(e.$delegate));
  2. Check out the page
  3. Click anywhere outside the a tag on the page
  4. Observe console

Current behavior Click handled and e.$delegate is null

Expected behavior Click on improper target should not be handled

Priority: ⚠️ CRITICAL ⚠️

ala-n commented 5 months ago

:tada: This issue has been resolved in version 5.0.0-beta.11 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

ala-n commented 4 months ago

:tada: This issue has been resolved in version 4.15.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: