Problem description
The textfield function "getValue()" returns the wrong (old) value, if the autocorrection replace the misspelled word.
Steps to reproduce
1. Click into the textfield
2. Enter a misspelled word like "asdjflkjsd"
3. Click into the textfield as soon as the autocorrection appears
4. Click the button to alert the wrong misspelled textfield value again
Test case
(function() {
var win = Ti.UI.createWindow({backgroundColor:'#ffffff'});
var view = Ti.UI.createView({layout:'vertical'});
var button = Ti.UI.createButton({title:' Read textfield value ',top:20,borderRadius:5,borderColor:'#1C1C1C',backgroundColor:'#C0C0C0'});
var textfield = Ti.UI.createTextField({
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
autocapitalization: Titanium.UI.TEXT_AUTOCAPITALIZATION_NONE,
top: 70,
height: 30,
width:Titanium.UI.FILL
});
var label = Ti.UI.createLabel({left:20,top:20,width:Titanium.UI.FILL,font:{fontSize:12},
text:'PROBLEM DESCRIPTION\n'
+'The textfield function "getValue()" returns the wrong (old)value, if the autocorrection replace the misspelled word\n\n'
+'STEPT TO REPRODUCE\n'
+'1. Click into the textfield\n'
+'2. Enter a misspelled word like "asdjflkjsd"\n'
+'3. Click into the textfield as soon as the autocorrection appears\n'
+'4. Click the button to alert the wrong misspelled textfield value again.\n\n'
+'ENVIRONMENT\n'
+'Ti Mobile SDK: 3.4.0 GA, Ti Studio: 3.4.0.201409261227, iOS: 8.1 & 8.1.1, Device: iPhone 5 and 5S'});
button.addEventListener('click',function(e){
alert(textfield.getValue());
});
textfield.addEventListener('click',function(e){
if(textfield.getValue() !== ''){
alert(textfield.getValue());
}
});
view.add(textfield);
view.add(button);
view.add(label);
win.add(view);
win.open();
})();
[~ahossain], [~rtlechuga]: I've tested the issue using the latest 5.0 master and cannot reproduce a misspelled text. There is no autocorrection (and provide the property
autocorrect
). Please recheck the issue and if reproducible, attach some screens. Thank you guys! EDIT: Tested on both 8.X and 9.0Closing ticket as the issue cannot be reproduced and due to the above comments.