Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13337] Android: Event 'change' only fired when user interacts (since of 3.0.0)

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-04-09T23:02:11.000+0000
Affected Version/sRelease 3.0.0, Release 3.0.2
Fix Version/s2013 Sprint 07
ComponentsAndroid
Labelsregression, triage
ReporterMathias Immerkær
AssigneeHieu Pham
Created2013-01-23T13:05:24.000+0000
Updated2017-03-21T21:36:21.000+0000

Description

As of 3.0.0 event 'change' is only fired when the user interacts directly and not when other parts of the program changes a value. Try running the following code in 3.0.0 and 2.1.4 and you will notice the difference.

Titanium.UI.setBackgroundColor('#000');

var tabGroup = Titanium.UI.createTabGroup();


var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});

var textField = Ti.UI.createTextField({
	color:'#000',
	top:10,
	width:400,
	height:'auto'
});

win1.add(textField);

textField.addEventListener('change',function(e){
	alert("I've changed!");
});


var button = Titanium.UI.createButton({
   title: 'Push me!',
   width: 100,
   height: 50
});

button.addEventListener('click',function(e)
{
   textField.value = "1234";
});

win1.add(button);


tabGroup.addTab(tab1);  
 
tabGroup.open();

Comments

  1. Hieu Pham 2013-04-09

    Unable to reproduce on latest master. Closing issue.
  2. Ping Wang 2013-04-10

    Probably fixed by TIMOB-12139.
  3. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source