Skip to content

Move target attributes to event['target'] #548

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

Closed
rmorshea opened this issue Dec 15, 2021 · 0 comments · Fixed by #550
Closed

Move target attributes to event['target'] #548

rmorshea opened this issue Dec 15, 2021 · 0 comments · Fixed by #550
Labels
priority-2-moderate Should be resolved on a reasonable timeline. type-revision About a change in functionality or behavior
Milestone

Comments

@rmorshea
Copy link
Collaborator

Current Situation

Currently attributes of the event target are simply assigned to the top-level of the event object. In retrospect this was a mistake because there are different kinds of targets (e.g. currentTarget and relatedTarget) in addition to the possibility of conflicts with the event's own attributes.

Proposed Changes

Create new keys in event information for "currentTarget", and "relatedTarget" where target element attributes will be stored. In addition event information for target will be moved under a new "target" key.

Implementation Details

Since attributes of target are currently available at the top-level of the event dictionary, to avoid an immediate backwards incompatible change, we will create an EventProxy object that wraps the original event data and aliases any missing keys to event['target'][key]. When the EventProxy object needs to alias a key in this way, it will produce a warning that attributes of target have been moved to the "target" key.

@rmorshea rmorshea added the flag-triage Not prioritized. label Dec 15, 2021
@rmorshea rmorshea self-assigned this Dec 15, 2021
@rmorshea rmorshea removed their assignment Jan 11, 2022
@rmorshea rmorshea added this to the 1.0 milestone Jan 11, 2022
@rmorshea rmorshea added enhancement priority-2-moderate Should be resolved on a reasonable timeline. type-revision About a change in functionality or behavior and removed flag-triage Not prioritized. type: feature labels Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-2-moderate Should be resolved on a reasonable timeline. type-revision About a change in functionality or behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant