Skip to content

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

Closed
@rmorshea

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority-2-moderateShould be resolved on a reasonable timeline.type-revisionAbout a change in functionality or behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions