Skip to content

Commit

Permalink
fix(android): do not modify original ListView proxy (#11319)
Browse files Browse the repository at this point in the history
Fixes TIMOB-27496
  • Loading branch information
garymathews authored and sgtcoolguy committed Nov 11, 2019
1 parent 68d491e commit e75b514
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.HashMap;

import org.appcelerator.kroll.KrollDict;
import org.appcelerator.kroll.KrollProxy;
import org.appcelerator.kroll.annotations.Kroll;
import org.appcelerator.titanium.TiC;
import org.appcelerator.titanium.proxy.TiViewProxy;
Expand Down Expand Up @@ -55,6 +56,11 @@ private void fireItemClick(String event, Object data)
TiViewProxy source = (TiViewProxy) eventData.get(TiC.EVENT_PROPERTY_SOURCE);
if (source != null && !source.equals(this) && listProxy != null) {

// FIXME: We should not need to create a placeholder proxy for each item. ListView needs refactoring to remedy this.
source = (TiViewProxy) KrollProxy.createProxy(source.getClass(), source.getKrollObject(), new Object[0],
source.getCreationUrl().url);
eventData.put(TiC.EVENT_PROPERTY_SOURCE, source);

// append bind properties
if (eventData.containsKey(TiC.PROPERTY_BIND_ID) && eventData.containsKey(TiC.PROPERTY_ITEM_INDEX)
&& eventData.containsKey(TiC.PROPERTY_SECTION)) {
Expand Down

0 comments on commit e75b514

Please sign in to comment.