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

fix(user-interaction): event listeners have wrong this when listening for bubbled events #643

Merged
merged 6 commits into from Aug 31, 2021

Conversation

t2t2
Copy link
Contributor

@t2t2 t2t2 commented Aug 26, 2021

Which problem is this PR solving?

this inside event listeners gets changed to event.target, which is incorrect when listening to bubbled events (click on a child element)

see: https://codesandbox.io/s/inspiring-bartik-6bc3y?file=/src/index.js

Short description of the changes

Use this the event listener is actually called with

@t2t2 t2t2 requested a review from a team as a code owner August 26, 2021 08:02
@codecov
Copy link

codecov bot commented Aug 26, 2021

Codecov Report

Merging #643 (c047e15) into main (8584432) will not change coverage.
The diff coverage is n/a.

❗ Current head c047e15 differs from pull request most recent head f684015. Consider uploading reports for the commit f684015 to get more accurate results

@@           Coverage Diff           @@
##             main     #643   +/-   ##
=======================================
  Coverage   96.68%   96.68%           
=======================================
  Files          13       13           
  Lines         634      634           
  Branches      124      124           
=======================================
  Hits          613      613           
  Misses         21       21           

Copy link
Member

@johnbley johnbley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤭 ... I should have made the tests better when I reworked the event listener instrumentation.

Copy link
Member

@obecny obecny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@obecny obecny added the bug Something isn't working label Aug 26, 2021
@dyladan
Copy link
Member

dyladan commented Aug 27, 2021

I was going to merge this but then saw you're still pushing changes. Is this good to merge?

@t2t2
Copy link
Contributor Author

t2t2 commented Aug 27, 2021

Yep

@dyladan dyladan merged commit f0fa800 into open-telemetry:main Aug 31, 2021
@dyladan dyladan mentioned this pull request Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants