Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1637] iOS: Controls fire 'change' event on initial value set

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionCannot Reproduce
Resolution Date2012-07-25T16:18:51.000+0000
Affected Version/sRelease 1.5.0
Fix Version/sn/a
ComponentsiOS
Labelsparity
ReporterStephen Tramer
AssigneeNeeraj Gupta
Created2011-04-15T02:58:02.000+0000
Updated2012-07-26T22:22:55.000+0000

Description

Controls fire a 'change' event when the value is initially set. We should probably find a way to suppress this.

Comments

  1. Don Thorp 2011-11-05

    If the event listener is added and then the value changed, this seems like correct behavior even if it's initial value.
  2. Stephen Tramer 2012-07-25

    Could not reproduce in SDK 2.2.0.f9e938d on iPhone Sim 5.1. Test code (based on 'switch' control):
       var win = Ti.UI.createWindow();
       var s = Ti.UI.createSwitch({
       	value:true,
       	width:Ti.UI.SIZE,
       	height:Ti.UI.SIZE
       });
       s.addEventListener('change', function() {
       	Ti.API.info("Value changed!");
       });
       win.add(s);
       win.open();
       

JSON Source