[TIMOB-3297] iOS: Ti.UI.Switch click event does not fire
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2016-08-28T23:00:53.000+0000 |
Affected Version/s | Release 3.0.0, Release 3.1.0, Release 3.2.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | api, parity, supportTeam |
Reporter | Paul Dowsett |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T03:41:39.000+0000 |
Updated | 2017-03-20T21:26:10.000+0000 |
Description
Environment: iOS 4.2, Ti SDK 1.6, Mac OS
In the above environment, the switch click event does not fire. The following code demonstrates the issue. The same code works fine on Android.
Ti.UI.setBackgroundColor('#226');
var win1 = Ti.UI.createWindow({
title:'this is window1',
backgroundColor:'#fff'
});
var switch1 = Ti.UI.createSwitch({
value:false,
top:30
});
switch1.addEventListener('click', function(e) {
Ti.API.info('the switch has been switched to: '+e.source.value);
});
win1.add(switch1);
win1.open();
Though it's understood on iOS that this is possibly working as intended, the issue is parity.
Tested on a Samsung Galaxy S2 and the iOS simulator using TiSDK 2.2.0v20120904101713, issue still valid.
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 iOS iPhone Simulator: iOS SDK version: 6.0
This issue is invalid. Switch-controls are not supposed to fire click-events for changed values. As the [docs say](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Switch-event-change), the
change
event is supposed to handle the changed values.[~hansknoechel] Could we hide the click event in the docs? If it doesn't do anything, should it be documented?
Added the docs-phrase [here](https://github.com/appcelerator/titanium_mobile/pull/8284) by referencing the TiUIView docs and adding a note about using the correct event.
Closing ticket as invalid.