Details
-
Type:
New Feature
-
Status: Closed
-
Priority:
Medium
-
Resolution: Fixed
-
Affects 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
-
Component/s: Android
-
Labels:
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
- relates to
-
TIMOB-6000 Android: replacing the textfield value makes the cursor go back to the start
-
- Closed
-
-
TIMOB-10460 iOS: implement setSelection() for TextField and TextArea
-
- Closed
-