var win = Ti.UI.createWindow({
backgroundColor : 'white',
exitOnClose : true,
fullscreen : false,
layout : 'vertical',
title : 'hasText Demo'
});
var textField = Ti.UI.createTextField({
color: '#336699',
backgroundColor:'#eee',
top: 10, left: 10,
width: 250, height: 60,
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED
});
win.add(textField);
var textArea = Ti.UI.createTextArea({
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
backgroundColor:'#eee',
color: '#336699',
top: 10, left: 10,
width: 250, height: 200
});
win.add(textArea);
win.open();
textField.addEventListener('change', function(e){
Ti.API.info('hasText? ' + e.source.hasText());
});
textArea.addEventListener('change', function(e){
Ti.API.info('hasText? ' + e.source.hasText());
});
Pull pending https://github.com/appcelerator/titanium_mobile/pull/1841
Pull merged, not sure on the release number.
hasText does still not work. I've added a test case to prove this.
Paul's test code was incorrect--was attempting to call hasText() on the event object, rather than the text field/text area itself. Updated test code works on iOS and Android. MW has an issue I'll file separately.
Closing issue Tested with Ti Studio build 2.1.0.201206211609 Ti Mobile SDK 2.1.0.v20120622174154 hash rdc9dfbe5 OSX Lion 10.7.3 iPhone 4S OS 5.1 Verified expected behavior is shown
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4876