Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9324] iOS: Ti.UI.Switch control fires 'change' event on view loading.

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-04-01T11:38:46.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 3.0.2
ComponentsiOS
Labelscommunity
ReporterDino Bartosak
AssigneeShameer Jan
Created2012-05-24T11:12:33.000+0000
Updated2017-03-21T21:27:34.000+0000

Description

When Ti.UI.Switch control is added to some view it fires 'change' even first time. Expected behavior is that it fires 'change' event only when user clicks on it. Tested with Titanium SDK 2.1.0 on iOS 5.0 Simulator

var win = Ti.UI.createWindow();

var simpleSwitch = Ti.UI.createSwitch({
	value : false
})

win.add(simpleSwitch);

simpleSwitch.addEventListener('change', function(e) {
	alert('Switch value: ' + e.value)
})

win.open();


Comments

  1. Shameer Jan 2013-04-01

    Issue does not reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
  2. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced.

JSON Source