[TIMOB-24273] iOS: Overwriting existing event listeners only calls the last one (Regression from 6.0.1)
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-01-05T18:35:33.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | iOS |
Labels | ios, regression |
Reporter | Christoph Eck |
Assignee | Christopher Williams |
Created | 2017-01-04T11:24:51.000+0000 |
Updated | 2017-01-05T23:24:24.000+0000 |
Description
*Problem*
Overwrites the click event listeners if there is more than one defined.
actual behavior
click in example on the label
in the log is shown 'click3'
expected behaviorclick in example on the label
in the log is shown 'click1, click2 and click3'
*Test case*
var win = Ti.UI.createWindow({height: Ti.UI.SIZE, width: Ti.UI.SIZE, backgroundColor: "white"});
var label = Ti.UI.createLabel({text: "label"});
var view = Ti.UI.createView({height: Ti.UI.SIZE, width: Ti.UI.SIZE});
view.add(label);
win.add(view);
win.open();
view.addEventListener('click', function(event){
Ti.API.info('click1');
});
view.addEventListener('click', function(event){
Ti.API.info('click2');
});
view.addEventListener('click', function(event){
Ti.API.info('click3');
});
*Log*
actual behavior
{noformat}
[INFO] : click3
{noformat}
expected behavior
{noformat}
[INFO] : click
[INFO] : click2
[INFO] : click3
{noformat}
Ok, after some investigation, I found out that [this change](https://github.com/appcelerator/titanium_mobile/pull/8659) caused the regression in 6.1.0 master. It works properly in 6.0.1.GA.
https://github.com/appcelerator/titanium_mobile/pull/8731
Verified fixed, When clicking on the label the log now shows:
*Environment*