Android TextField broken - Build 606

I’ve been struggling with getting the Android build of our in-market iOS app fully working and have narrowed it down to a specific issue with the TextField. I’ve been able to isolate the issue as follows:

  1. Calling native.setKeyboardFocus(nil) to clear the focus/remove keyboard will set the focus to another textfield

  2. Tapping on a textfield drawn near the bottom of the screen causes all textfields to vanish

#1 above is of particular concern because hiding the keyboard sends a “began” event to another textfield causing undesired execution of code in our app.
#2 is just a plain showstopper.

You can verify the above by running this sample app below and trying the following:

  1. Tap on the first textbox (keyboard comes up)

  2. Tap anywhere on the screen (keyboard is hidden, but focus jumps to textbox 2)

  3. Tap on the 3rd textbox (all textboxes vanish)

local textField = nil  
local textField2 = nil  
local textField3 = nil  
  
local function hideKeyboard(event)  
 print ("hideKeyboard called.")  
 native.setKeyboardFocus(nil)  
end  
  
local function main()  
 Runtime:addEventListener("tap", hideKeyboard)  
 textField = native.newTextField(display.contentCenterX - 100, display.contentCenterY - 200, 300, 60)  
 textField2 = native.newTextField(display.contentCenterX - 100, display.contentCenterY, 300, 60)  
 textField3 = native.newTextField(display.contentCenterX - 100, display.contentCenterY + 200, 300, 60)  
  
end  
  
main()  

Can someone please verify this and let me know an ETA on a fix as this is blocking us from being able to publish for Android. [import]uid: 8692 topic_id: 14115 reply_id: 314115[/import]

Hey there,

Were you having these issues with 591 or is it only since you started using a daily build?

Peach :slight_smile: [import]uid: 52491 topic_id: 14115 reply_id: 51975[/import]

I’ve had the issues since 591 but was finally able to isolate to the above root cause and still happening with the latest daily build. Can you confirm the behavior described above?

Thanks! [import]uid: 8692 topic_id: 14115 reply_id: 52002[/import]

Any update on this particular bug? [import]uid: 8545 topic_id: 14115 reply_id: 52412[/import]

is there a bug number associated with this? i looked at our bugbase and i can’t find anything

if there is no bug entered, can you enter one and let me know bug number so i can prioritze it.

.c
[import]uid: 24 topic_id: 14115 reply_id: 52539[/import]

There are two bugs: 7633, and 7634. [import]uid: 8692 topic_id: 14115 reply_id: 52937[/import]

Any word on this particular one? It’s stopping our submission as of now. [import]uid: 8545 topic_id: 14115 reply_id: 54632[/import]

Hi any word on this bug?

I also encounter this bug when developing text-fields for Android and it is stopping my submission as well.

Thanks. [import]uid: 10741 topic_id: 14115 reply_id: 55149[/import]

GAH!!! Has anyone gotten around this?

My entire app is dependent on user input. I have tried two things:

  • The first involved multiple textboxes which resulted in the focus bug above.
  • My second thought was to dynamically create the textfields and remove them once complete.
    However, if I call myTextfield:removeSelf() or myGroup:remove(myTextfield) then the app simply crashes.

This is only happening on Android. No issues with IOS.

Need HELP Please!! I cannot submit as is. [import]uid: 69863 topic_id: 14115 reply_id: 59972[/import]

Nope not yet. We are still waiting to be able to submit our app too. I’m sure many people are. [import]uid: 8545 topic_id: 14115 reply_id: 59974[/import]

Everyone,

The disappearing TextField issue caused by showing/hiding the virtual keyboard should be fixed in the newest daily build. However, if the TextField is at the bottom of the screen, then the screen will not automatically shift up when the virtual keyboard is shown. The virtual keyboard will simply overlay on top of the field. We have this same issue on iOS as well.

I’ll have a look at the other TextField and keyboard issues mentioned above next week.
[import]uid: 32256 topic_id: 14115 reply_id: 59980[/import]

I’ve just confirmed this is NOT fixed as of daily build 632. Please try the code posted in this thread to repro the disappearing textfield bug as described. [import]uid: 8692 topic_id: 14115 reply_id: 60102[/import]

afonseca,

The fix I implemented was to be in build 633. For some reason our build server did not automatically build it over the weekend. We’ll look into it on Monday… along with the other TextField and keyboard issues shortly after. [import]uid: 32256 topic_id: 14115 reply_id: 60103[/import]

Great, thanks for the update. I’ll check on build 633 when it’s available and post an update here. [import]uid: 8692 topic_id: 14115 reply_id: 60104[/import]

Everyone,

We’ve made several fixes to our TextField and keyboard handling today which should address all of the issues mentioned in this thread. These fixes will be made availabe in the next daily build #636. If you can test this with your app and let us know if it has solved the problems that you’ve encountered, then that would be great.

Thanks you for bringing these issues to our attention and for your patients. And I apolgize for the delay. Especially if it has delayed you in releasing your app. [import]uid: 32256 topic_id: 14115 reply_id: 60319[/import]

Great, the issues in this thread are fixed in the new build.

I did find another issue related to textfields where setting the text property resets the cursor to the beginning of the string instead of the end. This is an issue when validating a string when a user is typing. For example, changing the text to be all caps as the user types it currently jumps the cursor to the start of the string and there’s no way to set it back. [import]uid: 8692 topic_id: 14115 reply_id: 65138[/import]

Oh, and this bug was filed back in August, see case # 7598. [import]uid: 8692 topic_id: 14115 reply_id: 65141[/import]

Alberto,

I added your cursor issue #7598 to my to-do list. A bit of warning, we’re working on finishing a new release version of Corona, so we may not have time to address this issue anytime soon. But if it is a small change, we’ll see about sneaking it in. [import]uid: 32256 topic_id: 14115 reply_id: 65144[/import]

I also have issue #7598 on Android. [import]uid: 94304 topic_id: 14115 reply_id: 87708[/import]