Move target attributes to event['target'] #548
Labels
priority-2-moderate
Should be resolved on a reasonable timeline.
type-revision
About a change in functionality or behavior
Milestone
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
andrelatedTarget
) 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 fortarget
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 anEventProxy
object that wraps the original event data and aliases any missing keys toevent['target'][key]
. When theEventProxy
object needs to alias a key in this way, it will produce a warning that attributes oftarget
have been moved to the"target"
key.The text was updated successfully, but these errors were encountered: