Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23987] iOS: Ti.UI.Switch should default to false but is undefined

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2016-10-05T19:18:16.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sn/a
ComponentsiOS
Labelsqe-6.0.0
ReporterJosh Longton
AssigneeHans Knöchel
Created2016-10-05T17:53:25.000+0000
Updated2017-03-16T20:33:05.000+0000

Description

Steps to reproduce:

Create a new classic project appc new

Replace the app.js with the one below.

app.js

{noformat} var win = Ti.UI.createWindow({ backgroundColor: 'white' }); var basicSwitch = Ti.UI.createSwitch(); win.add(basicSwitch); basicSwitch.addEventListener('change',function(e){ Ti.API.info('Switch value: ' + basicSwitch.value); }); win.open(); Ti.API.info('Switch value: ' + basicSwitch.value); {noformat}

Actual

{noformat} [INFO] : Switch value: undefined {noformat}

Expected

The default value should be false {noformat} [INFO] : Switch value: False {noformat}

Comments

  1. Hans Knöchel 2016-10-05

    Duplicate of TIMOB-9007, already fixed.
  2. Lee Morris 2017-03-16

    Closing ticket as duplicate.

JSON Source