[TIMOB-9723] Android: Textfield:Focus event is getting fired with blur event call on orientation change.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 2.1.0, Release 3.1.0 |
Fix Version/s | n/a |
Components | Android |
Labels | api, qe-and060112 |
Reporter | Shyam Bhadauria |
Assignee | Unknown |
Created | 2012-06-22T03:42:53.000+0000 |
Updated | 2018-02-28T20:03:26.000+0000 |
Description
This is not a regression. It exists as far as 1.8.2
Steps to reproduce:
1) Use the code below:
var win = Ti.UI.createWindow();
win.backgroundColor='red';
var tf = Titanium.UI.createTextField({
backgroundColor: "#fff",
width : 250,
height : 80,
focusable : true,
});
win.add(tf);
tf.addEventListener('focus', function() {
alert('Focus fired');
});
Ti.Gesture.addEventListener("orientationchange", function() {
tf.blur();
alert('blur fired');
});
win.open();
2) Run the app
3) Click 'ok' on the focus alert and rotate device to a new orientation.
Expected result:
2) After step 2,app should be running and an alert 'Focus fired' should be displayed.
3) Alert 'Blur fired' should be displayed.
Actual result:
2) After step 2,app is running and an alert 'Focus fired'is displayed.
3) 2 alerts 'Blur fired' and 'Focus fired' are displayed.
Focus event should not get fired.It is not called in orientationchange eventlistener.
Issue reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Device: Samsung galaxy s duos Android version: 4.0.4