Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-17551

iOS: TextField return a Number instead of String

    Details

    • Type: Bug
    • Status: Open
    • Priority: None
    • Resolution: Unresolved
    • Affects Version/s: Release 3.3.0
    • Fix Version/s: None
    • Component/s: iOS
    • Environment:

      3.3.0 (iOS Simulator)

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sko Matej
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-19103
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration