Issue
Currently when user enables as true the property enableReturnKey in a textField or textArea in iOS the button is disabled until the value is different from null while in the case of Android is not working even when the documentation specify that the property is enabled for Android in textfield (
http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.TextField-property-enableReturnKey ) and textarea (
http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.TextArea-property-enableReturnKey ).
Test Case
var win = Ti.UI.createWindow();
var tf = Ti.UI.createTextField({
enableReturnKey:true,
});
tf.addEventListener('return',function(){
alert(tf.value);
});
win.add(tf);
win.open();
Steps to repro
Run the app
Select the textfield
Click on the Return Key
Expected Result
The Return key will be disabled preventing the action from being executed until the textfield value is different form null.
Actual Result
The result key is enabled from start allowing user to call the action even there no value on textfield
You can't disable a key on the soft-keyboard on Android, but we shouldn't fire 'return' event when the text is empty with enableReturnKey set to true. I will fix this and update the doc accordingly
master PR: https://github.com/appcelerator/titanium_mobile/pull/5741
Testing steps: 1. Run code in description 2. Click on return key, check log. 'return' event should not fire.
PR merged
Environment - Appcelerator Studio - 3.3.0.201407111535 SDK - 3.4.0.v20140815142514 ACS - 1.0.16 Alloy - 1.4.1 NPM - 1.3.2 Titanium - 3.3.0 Code-processor - 1.1.1 Xcode - 6Beta5 OS - Mavericks(v10.9.4) Devices - Nexus 7(v4.4), Nexus 5(v4.4.4), iPhone5(v7.1.2) Result - Now its working fine for Android. 'return' event does not show in log for Android. On iOS, return key is disabled
Tested using below environment - Environment - Appc Studio - 3.4.0.201408180158 SDK - 3.4.0.v20140815142514 acs - 1.0.16 alloy - 1.5.0-dev npm - 1.3.2 titanium - 3.4.0-dev titanium-code-processor - 1.1.1 OS - mavericks (v10.9.4) Xcode - 6Beta5 Device - iPhone5 (v7.1.2), Nexus5(v4.4.4) Result - Its working fine for Android. 'return' event does not show in log for Android. On iOS, return key is disabled. Hence closing this issue.