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: escape hatch for async event target accessor #1510

Merged
merged 3 commits into from
Sep 17, 2019

Conversation

ravijayaramappa
Copy link
Contributor

@ravijayaramappa ravijayaramappa commented Sep 17, 2019

Details

When event's original target is from a non-keyed node, do not retarget event when accessed asynchronously

Does this PR introduce breaking changes?

  • No, it does not introduce breaking changes.

If yes, please describe the impact and migration path for existing applications.

The PR fulfills these requirements:

  • Have tests for the proposed changes been added? ✅
  • Have you followed these instructions to clearly describe the issue being fixed or feature enhanced? ✅

When event's original target is from a non-keyed node, do not retarget event when accessed asynchronously
@@ -66,6 +67,10 @@ function targetGetter(this: Event): EventTarget | null {
// Handle cases where the currentTarget is null (for async events),
// and when an event has been added to Window
if (!(originalCurrentTarget instanceof Node)) {
// If the event's target is being accessed async and originalTarget is not a keyed element, do not retarget
Copy link
Contributor

Choose a reason for hiding this comment

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

we should add an issue to remove this in the future... with a TODO in the code.

Copy link
Contributor

Choose a reason for hiding this comment

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

we should also do this in 222 too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filed #1511

Copy link
Contributor

@caridy caridy left a comment

Choose a reason for hiding this comment

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

just add the TODO for the future removal

@ravijayaramappa ravijayaramappa merged commit 1e55195 into master Sep 17, 2019
@ravijayaramappa ravijayaramappa deleted the ravi/master/escape-hatch-async-events branch September 17, 2019 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants