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.
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
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