Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 in esl-event-listener]: ESLDecoratedEventTarget` mutate original event's target #1534

Closed
ala-n opened this issue Mar 9, 2023 · 1 comment
Assignees
Labels
bug Something isn't working released

Comments

@ala-n
Copy link
Collaborator

ala-n commented Mar 9, 2023

ESLDecoratedEventTarget`` replaces original event target` with incorrect value

Steps:

class MyComponent extends ESLBaseElement {
   @listen({
      event: 'resize',
      target: ESLEventUtils.decorate(window, debounce, 250)
   })
   onResize(e: Event) {
      console.log(e.target);
   }
}

Current:

e.target === ESLEventUtils.decorate(window, debounce, 250)

Expected:

e.target === window

@ala-n ala-n added waits triage Issue that waits to be reviewed and handled bug Something isn't working and removed waits triage Issue that waits to be reviewed and handled labels Mar 9, 2023
@ala-n ala-n self-assigned this Mar 9, 2023
@ala-n ala-n added this to the ⚡ESL: 4.4.0 Minor release milestone Mar 9, 2023
@ala-n ala-n closed this as completed in d5e2c78 Mar 15, 2023
ala-n pushed a commit that referenced this issue Apr 12, 2023
# [4.4.0](v4.3.1...v4.4.0) (2023-04-12)

### Bug Fixes

* **esl-event-listener:** fix `ESLEventTargetDecorator` dispatched event `target` ([8252988](8252988))
* **esl-event-listener:** fix target delegation checking ([b307ce6](b307ce6))
* **esl-event-listener:** fix typechecking for TS5 ([d434275](d434275))
* **esl-media:** fix `iv_load_policy` param and small test regexp optimization in YouTube provider ([2deb64b](2deb64b))
* **esl-utils:** `SynteticEventTarget` no longer mutate `event.target` without need; `event.currentTarget` fix to current instance ([d5e2c78](d5e2c78)), closes [#1534](#1534)

### Code Refactoring

* **esl-event-listener:** change API of extended EventTargets ([39b01cc](39b01cc))

### Features

* **esl-base-element:** `ESLBaseElement.prototype.baseTagName` shortcut ([c10fc6d](c10fc6d))
* **esl-core:** make `this.constructor` strictly typed for `ESLBaseElement` and `ESLMixinElement` ([824ca1c](824ca1c))
* **esl-event-listener:** improved `ESLResizeObserverTarget` API with a standardized `ESLElementResizeEvent` ([8e1d72e](8e1d72e))
* **esl-event-listener:** support for `ESLDomElementTarget` in `ESLResizeObserverTarget` ([#1573](#1573)) ([f177381](f177381))
* **esl-utils:** `getEventListeners()` method introduced for `SynteticEventTarget` ([#1548](#1548)) ([c293b61](c293b61))

### BREAKING CHANGES

* **esl-event-listener:** beta `ESLEventUtils.resize` replaced with `ESLResizeObserverTarget.for`
* **esl-event-listener:** beta `ESLEventUtils.decorate` replaced with `ESLDecoratedEventTarget.for`
@ala-n
Copy link
Collaborator Author

ala-n commented Apr 12, 2023

🎉 This issue has been resolved in version 4.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ala-n ala-n added the released label Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

1 participant