[TIMOB-1465] Keyboard bounces up and down when focusing next text field
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2012-06-25T13:43:36.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | blur, focus, ios, iphone, keyboard |
Reporter | Carmen Wick |
Assignee | Neeraj Gupta |
Created | 2011-04-15T02:53:35.000+0000 |
Updated | 2017-03-09T21:29:30.000+0000 |
Description
I have a text field and some code to focus the next text field on the screen when the return key is tapped:
var txt = Titanium.UI.createTextField({
height: 35,
width: 200,
right: 10,
borderStyle = Titanium.UI.INPUT_BORDERSTYLE_LINE,
autocorrect = false
});
txt.addEventListener('return', function()
{
nextTextField.focus();
});
The problem is that about 60-90% of the time, the keyboard bounces down and up just a little bit before the next field is focused. I don't want this to happen; the keyboard should not move while the next text field is receiving focus because it's very distracting to the user.
I'm having this same issue on my iPhone 4 device (but not in the simulator).
Assigning to Mr. Haynie.
I have tested android for this issue and, as of the latest build 1.4.x, android is not affected.
Adding suppressReturn=false to the textfield seems to fix the problem. No idea why this works.
I would think that suppressReturn=false would mean "No, do NOT suppress the default handling of the Return key, which would be to unfocus the text field" and suppressReturn=true would mean, "Yes, please DO suppress the default handling of the Return key. Do nothing when return is pressed, instead relying on the application to provide an event handler via the 'return' event on the textfield."
Fixed as part of TIMOB-628 fixes. See docs for behavior of suppressReturn
Closing ticket as duplicate.