Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10460] iOS: implement setSelection() for TextField and TextArea

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-08-31T15:52:22.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Sprint 2012-18 API
ComponentsiOS
Labelsapi, module_textarea, module_textfield, parity, qe-review, qe-testadded
ReporterHieu Pham
AssigneeHieu Pham
Created2012-08-15T18:30:51.000+0000
Updated2013-11-07T05:35:28.000+0000

Description

1. Run this code
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({backgroundColor: "#fff"});
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();
2. Click on button. "This" should be selected. 3. Comment out the first line, uncomment the 2nd line and re-run 4. Click on button, should see same behavior.

Comments

  1. Max Stepanov 2012-08-31

    PR merged https://github.com/appcelerator/titanium_mobile/pull/2855
  2. Shyam Bhadauria 2012-09-10

    Environment used for verification - Titanium SDK: 2.2.0.v20120907162025 Titanium  Studio: 2.1.3.201209071738 Device - Simulator iOS 5.1 Machine OS - MAC 10.8
  3. Shameer Jan 2013-11-07

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4863
  4. Shameer Jan 2013-11-07

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4876

JSON Source