[TIMOB-7842] Android: Ti.UI.TextField.return event gets fired twice
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-03-02T19:13:43.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Sprint 2012-05, Release 2.0.0 |
Components | Android |
Labels | module_textfield, parity, qe-testadded |
Reporter | Junaid Younus |
Assignee | Hieu Pham |
Created | 2012-02-28T13:27:29.000+0000 |
Updated | 2012-03-14T17:03:06.000+0000 |
Description
*Code*
var win = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var textField = Ti.UI.createTextField({
color: '#336699',
height: 50,
top: 100,
left: 100,
width: 250,
returnKeyType: Ti.UI.RETURNKEY_SEARCH
});
var counter = 0;
textField.addEventListener('return', function(e)
{
Ti.API.info('This should only be printed once.');
win.backgroundColor = (++counter % 2 == 0) ? 'red' : 'yellow';
});
win.add(textField);
win.open();
*Expected result*
When you tap on the textfield and then click on the return key, the event listener should only be fired once.
*Actual result*
When you do the above, the event gets fired twice.
*Note*
-I tried it with TiSDK 1.8.1 and the latest master from github, both seem to have this issue.
-When you comment out the line 'returnKeyType: Ti.UI.RETURNKEY_SEARCH', it seems to work fine and the event is only fired once.
-I only seem to be able to produce this issue with some devices. Issue happens on a Nexus One (2.3.6), Samsung Exhibit 4G (2.3.3) and Droid Bionic (2.3.4). I don't seem to be able to reproduce this issue on a Samsung Sensation 4G (2.3.3).
Also test in KS: Base UI -> Views -> Table Views -> Table View (Layout 2) - Tap the 'Next' button and the keyboard should hide itself.
Closing as Fixed. SDK: 2.0.0.v20120307090205 Android: V8, Rhino Studio: 1.0.9.201202141208 OS: Snow Leopard Devices Tested: Nexus One 2.2.2, Droid3 2.3.4, Xoom 3.2.1