[AC-1048] View.addEventListener doesn't always add an event listener
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2015-04-06T23:34:34.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | TCSupportTriage, addeventlistener, fireevent |
Reporter | Ranando Kking |
Assignee | Radamantis Torres-Lechuga |
Created | 2014-12-09T17:31:24.000+0000 |
Updated | 2016-03-08T07:37:23.000+0000 |
Description
Sometimes View.addEventListener doesn't actually add the event listener to the object. Sometimes fireEvent doesn't fire the event, even when the event is added properly. While I'm able to consistently reproduce this error, the circumstances required to reproduce it aren't clear.
Debugging into addEventListener revealed that when the error occurs, the event is added to the "listeners" with a value of 0 instead of 1. When a subsequent fireEvent is called for the same event, hasListeners returns 0, and no event is fired.
The events that are failing are being added to a view that is never displayed. It is created with no properties and is only used for the sake of event management. I've also encountered cases when fireEvent fails despite hasListeners returning 1. Debugging into fireEvent revealed that in this case [proxyView interactionEnabled] is returning false. This should not be the case since the view object that the events are being added to and fired from is the same view, property-less view I previously described. I never set view.touchEnabled = false for this view, nor do I ever add this view to anything.
When I can produce an isolated set of code that reproduces the issue, I will add it to this report.
Hello! We tried a simple event listener over a view, and looks like working. If you find a testcase where we can reproduce this issue, please post it. Best Regards