OwnerProxy overwrites inEvent.index during decorateEvent

Description

Discovered by jbremmer on the forums.

If you put a Repeater in a Repeater, the onSetupItem handler of the cihld Repeater will always receive the same index of the parent (Example). During the decorate event phase, the container OwnerProxy overrides the index value because is doesn't first check for the existence of the property before setting it.

Fix for enyo.OwnerProxy

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 enyo.kind({ name: "enyo.OwnerProxy", tag: null, decorateEvent: function(inEventName, inEvent, inSender) { if (inEvent && !("index" in inEvent)) { inEvent.index = this.index; } this.inherited(arguments); }, delegateEvent: function(inDelegate, inName, inEventName, inEvent, inSender) { if (inDelegate == this) { inDelegate = this.owner.owner; } return this.inherited(arguments, [inDelegate, inName, inEventName, inEvent, inSender]); } });

Environment

Chrome

Status

Assignee

Ryan Duffy

Reporter

Ryan Duffy

Labels

External issue ID

None

Tango Test Run Elements

None

Old Issue Key

None

Components

Fix versions

Affects versions

2.2

Priority

None