[TIMOB-23954] iOS: Events not firing from the child view if created dynamically (using run-on-mainthread)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2017-01-03T12:39:34.000+0000 |
Affected Version/s | Release 5.4.0, Release 5.5.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | ios, run-on-main-thread |
Reporter | Niraj Kumar |
Assignee | Eric Merriman |
Created | 2016-09-17T20:15:25.000+0000 |
Updated | 2017-03-22T21:59:27.000+0000 |
Description
When creating views using Alloy or Classic code of Appcelerator API dynamically and adding those views to the window or view created in other controller, which has event associated with it; the event with the parent view does not get fired when clicked on the child view. Please look into the sample app with this link:
[https://www.dropbox.com/s/3x82na9nqt7l3oa/SampleApp.zip?dl=0]
Appcelerator SDK: 5.4.0.GA/5.5.0.GA
*Workaround*: Disable
run-on-main-thread
temporary.
You are adding child-views to the container and have the click-listener on the container - which never gets clicked because you click on the children, not the container. So you should rather make the click-listener on each view and delegate the event through a callback to your index-controller.
Hi Hans, Thank you for the reply. I have tried the same code using Appcelerator SDK 5.3.1.GA and earlier and that is working fine. I hope to get the same response from the later SDKs too. Also, in 5.4.0.GA, if we try by adding labels only, it works fine. The problem is with the adding views dynamically only.
Should I expect to get the solution now?
@Hans: Thanks for the reply. Can you please help me to know where can I get the patch from?
Can you see a different behavior when having
run-on-main-thread
enabled/disabled? it might be relate to TIMOB-23934 which was fixed on master yesterday.When I set the value for
to true, it does not work as expected. But making it false works fine. Thanks a lot.
Test-case:
As suspected, it works with
run-on-main-thread
disabled, but is no duplicate of TIMOB-23934. Moved to TIMOB for further investigation!Also interesting: The bubbled click-event from "index" to "viewContainer" works, but the children of "viewContainer" don't.
Is this going on?
Resolving as Duplicate of TIMOB-23810 for further investigation by [~vijaysingh]!
Closing ticket as duplicate and links to the related ticket has been provided above.