[TIMOB-10460] iOS: implement setSelection() for TextField and TextArea
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-08-31T15:52:22.000+0000 |
| Affected Version/s | Release 3.0.0 |
| Fix Version/s | Release 3.0.0, Sprint 2012-18 API |
| Components | iOS |
| Labels | api, module_textarea, module_textfield, parity, qe-review, qe-testadded |
| Reporter | Hieu Pham |
| Assignee | Hieu Pham |
| Created | 2012-08-15T18:30:51.000+0000 |
| Updated | 2013-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.
PR merged https://github.com/appcelerator/titanium_mobile/pull/2855
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
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4863
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4876