Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17551] iOS: TextField return a Number instead of String

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.3.0
Fix Version/sn/a
ComponentsiOS
LabelsTCSupport, number, reprod, textfield
ReporterMatej
AssigneeUnknown
Created2014-08-06T15:53:05.000+0000
Updated2018-02-28T20:04:02.000+0000

Description

Problem Description

According to the documentation returned TextField value should be always String. The problem is that sometimes it may return a Number. See the example below:

Steps to reproduce

1. Create a new mobile project (classic Titanium) 2. Paste this code into app.js:
var win = Ti.UI.createWindow({
	backgroundColor: "white"
});

var tf = Ti.UI.createTextField({
	width: 230, height: 40,
	backgroundColor: "red"
});

tf.value = 10; // Shouldn't be this value converted to a string?

console.log(typeof tf.value); // number

setTimeout(function() {
	console.log(typeof tf.value); // string?
}, 1000);


win.add(tf);
win.open();
3. The textfield sometimes returns a number instead of a string.

Comments

  1. Shameer Jan 2014-08-27

    Issue reproduces on SDK Version 3.3.0 and 3.4.0 Titanium Command-Line Interface, CLI version 3.3.0, Titanium SDK version 3.3.0.GA Titanium SDK version 3.4.0.GA Appcelerator Studio, build: 3.3.0.201407111535 iOS SDK: 7.1 iOS iPhone Simulator: 7.1
  2. Lee Morris 2017-06-19

    I am able to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170609091155 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source