GitHub Issue | n/a |
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-08-15T13:22:14.000+0000 |
Affected Version/s | Release 1.8.0, Release 2.1.0, Release 2.0.1 |
Fix Version/s | Sprint 2012-16 API, Release 2.1.2, Release 3.0.0 |
Components | Android |
Labels | SupportTeam, api, module_textarea, parity, qe-testadded |
Reporter | Don Thorp |
Assignee | Hieu Pham |
Created | 2011-11-04T19:36:33.000+0000 |
Updated | 2012-12-21T19:48:34.000+0000 |
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.
Fixed by https://github.com/appcelerator/titanium_mobile/pull/2675
Verified fixed with mobile sdk-2.2.0.v20120810080115 Titanium Studio, build: 2.1.1.201207271312 Device: Galaxy S III Android version 4.0.4
Reopening to edit fixVersion
Fixed in 2_1_X by PR 2751