Issue
With a TextArea, one can programmatically set it to editable=false to commit the current autocompletion suggestion.
With a TextFiled, setting editable=false does not commit the autocompletion suggestion.
Reproduction steps
1. Run sample code
2. Type "test" into the TextArea (first field) - iOS will suggest "Test" (initial caps)
3. Click the "Get TextArea Value" button, and "Test" is alerted and the value of the TextArea is updated to reflect the committed autocompletion suggestion.
Actual behavior
If you reproduce the above steps in the TextField (second field), the autocompletion suggestion is not committed.
Expected behavior
To have the TextField work like the TextArea, so that the TextField works like the iOS native Messages app, committing the autocompletion suggestion on a button click.
Tested on
iOS 5.1 simulator
Actual Sample
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({
title: 'test',
layout: 'vertical'
});
var txtArea = Ti.UI.createTextArea({
width: 300,
height: 20,
top: 10
});
win.add(txtArea);
var btnArea = Ti.UI.createButton({
title: 'Get TextArea Value',
top: 10
});
win.add(btnArea);
btnArea.addEventListener('click', function(){
txtArea.editable=false;
alert(txtArea.value);
txtArea.editable=true;
});
var txtField = Ti.UI.createTextField({
width: 300,
height: 16,
top: 30,
backgroundColor: 'white'
});
win.add(txtField);
var btnField = Ti.UI.createButton({
title: 'Get TextField Value',
top: 10
});
win.add(btnField);
btnField.addEventListener('click', function(){
txtField.editable=false;
alert(txtField.value);
txtField.editable=true;
});
win.open();
try with 3.2.1 could not reproduce.
Closing ticket as the issue cannot be reproduced.