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

Android: Expose methods for controlling selection and cursor in TextField and TextArea

    Details

      Description

      TIMOB-6000 exposed a need for developers to be able to control the location and selection area of cursors in text fields since the current behavior is platform dependent.

      var text = Ti.UI.createTextField({top: 100, value: "This is Sparta."});
      //var text = Ti.UI.createTextArea({top: 100, value: "This is Sparta."});
       
      var win = Ti.UI.createWindow();
      var button = Ti.UI.createButton({bottom: 50, title: "text selection"});
      button.addEventListener('click', function(e) {
      	text.setSelection(0, 4);
      });
       
      win.add(text);
      win.add(button);
      win.open();
      

      Testing steps:

      1. Run code
      2. Click on button, should see "This" is selected
      3. Comment out the first line, uncomment the 2nd line and re-run
      4. Click on button, should see same behavior.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hpham Hieu Pham
                Reporter:
                dthorp Don Thorp
              • Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code