Skip to content

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

Closed

Description

@rmorshea

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.

Activity

  1. added
    flag-triage
    on Dec 15, 2021
  2. self-assigned this
    on Dec 15, 2021
  3. removed their assignment
    on Jan 11, 2022
  4. added this to the 1.0 milestone on Jan 11, 2022
  5. added
    priority-2-moderate
    type-revision
    and removed
    flag-triage
    on Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority-2-moderatetype-revision

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions