[TIMOB-17343] iOS: onBlur event on Textfield fired twice when click return button on keyboard
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2016-03-08T03:34:57.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | Textfield, ios, onBlur |
Reporter | David He |
Assignee | Angel Petkov |
Created | 2014-07-16T12:21:17.000+0000 |
Updated | 2017-03-31T22:44:42.000+0000 |
Description
onBlur event on Textfield fired twice when click return button on key borad.
Here is the latest test case for this problem.
var win = Ti.UI.createWindow({
backgroundColor : 'white'
});
var plainTemplate = {
childTemplates : [{
type : 'Ti.UI.TextField',
bindId : 'button',
properties : {
width : '80dp',
height : '30dp',
right : '10dp',
value : "122222",
borderStyle : Ti.UI.INPUT_BORDERSTYLE_ROUNDED
},
events : {
blur : function() {
alert("???");
}
}
}]
};
var listView = Ti.UI.createListView({
templates : {
'plain' : plainTemplate
},
defaultItemTemplate : 'plain'
});
var data = [];
for (var i = 0; i < 10; i++) {
data.push({
rowtitle : {
text : 'Row ' + (i + 1)
},
properties : {
itemId : 'row' + (i + 1),
accessoryType : Ti.UI.LIST_ACCESSORY_TYPE_NONE
}
});
}
var section = Ti.UI.createListSection({
items : data
});
listView.sections = [section];
win.add(listView);
win.open();
Can't reproduce.
Just extracted what I think possible to recreate the bug from my project and pasted the code here - have not tested the sample code here. I will modify the code and update it. Thanks
The above code snippet can definitely generate the issue - tested
Hi, What kind of device did you use when you find the problem, as I can't reproduce it with iOS 7.1 simulator. Regards, Shuo
iOS 7.1. Are you using the updated code?
Appears to be a general problem not a ALLOY specific one. Just use the updated code and you can readily reproduce it. Thanks
I WAS using the updated code. still can't reproduce your problem. Even tried with different simulator, different SDK and also iphone 4 device, none of them can reproduce your problem.
Would you please try to clean the project and restart the studio and simulator. See if the problem still appears.
What is your testing environment ? Ti SDK?
ye,I tried SDK 3.2.2, 3.2.3 and 3.3.0. all same.
Bizarre!~ Let me clean the project and give it another go. Will update you shortly
I tried clean the project still have this issue. Issue is firstly focus on anyone of these textfields and hit search/done button on textfield will trigger blur event twice..... You will see ??? two times....
I take a screen recording but unable to attach it to this ticket since it is being closed....
Oh I see you problem. I thought you just want the event lost the focus. Now I can reproduce the problem. I will forward this ticket to our engineer team. Thank you for your case.
Awesome, hopefully it could get sorted out by the next sub-version release of Ti.SDK. Thanks BTW, whereabouts are you? US? Then would`t be too late for you???
As a side note, return event will fire only once as opposed to blur..... Interesting.....
Hi there. I see this is listed as a bug (with a low priority), but I must say this is quite a serious issue. It only started when my app (using iOS7 SDK) was being used on iOS 8 Operating System. I then re-compiled the app to use iOS 8.2 SDK, but the issue remains. I use this scenario for field validation. What happens now is if the user enters something in the field where validation fails, the Return event triggers once, whilst the Blur event triggers twice.
Tested the Issue with the newest SDK with iOS 8.4 and higher. The issue doesn't seem to be reproducible, using the test code provided.Have you tried running the app on the newest [SDK](http://builds.appcelerator.com.s3.amazonaws.com/index.html#5_1_X) ?
Closing ticket as "Cannot Reproduce", if you encounter any further problems please file a new ticket.