Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16893] Android: textField and textArea enableReturnKey property not working

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-07-29T20:35:09.000+0000
Affected Version/sRelease 3.2.2
Fix Version/sRelease 3.4.0
ComponentsAndroid
Labelsmodule_textfield, qe-manualtest, qe-testadded, supportTeam
ReporterMarco Cota
AssigneeHieu Pham
Created2014-04-29T22:10:26.000+0000
Updated2014-08-19T05:43:36.000+0000

Description

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

Comments

  1. Hieu Pham 2014-05-28

    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
  2. Hieu Pham 2014-05-28

    master PR: https://github.com/appcelerator/titanium_mobile/pull/5741
  3. Hieu Pham 2014-05-28

    Testing steps: 1. Run code in description 2. Click on return key, check log. 'return' event should not fire.
  4. Vishal Duggal 2014-07-29

    PR merged
  5. Dhirendra Jha 2014-08-18

    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
  6. Dhirendra Jha 2014-08-19

    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.

JSON Source