Recently Lost Ability To Access Off Screen Native Text

@Joshua Are  you aware about changed behaviour for the input listener in iOS7? When you get the input.text on edit phase you do not get the letter that was just pressed, only he text excluding the letter that was just pressed. 

I can submit a bug report if needed if its not premature. 

Any updates on this issue?  @Tom, @Brent, and @Rob, I really appreciate that you guys have bumped up the priority on this.  It’s really great to see Corona staff actively on the forums and giving attention to issues and bug requests!  Keep up the good work guys!

I’m the Windows and Android developer here.  So, I’m not the best person to ask about iOS related issues.

But that said, if you think you’ve found a bug, then please submit a bug report.  That’s the best way to get issues on our radar.  Thanks.

Everyone,

This bug is now fixed.  The fix will be made available in daily build #1162.

Satheesh,

Thank you for taking the time to submit a bug report.  That got this issue on engineering’s radar and expedited the matter.

Everyone,

The offscreen TextField issue is now fixed for the Mac version of the Corona Simulator as well.  This fix will be made available in daily build #1176.

39785232.jpg

Lol!  downloading 1164 now! :smiley: :smiley:

Thanks again for this fix!  I’m currently using starter, so I don’t have access to daily builds.  Any idea when the next public release will drop?

We haven’t set a release date yet.

Come to think of it, I think you might be able to work-around this issue by setting “textField.isVisible = true” and setting the keyboard focus on it by using a timer right after you move the field offscreen.  This might fool the code into making it visible and editable again.  I haven’t tried it for myself, but it might be worth a shot.

Hey, that worked!  In my case the native text fields are off screen from the moment they are created (the X and Y parameters are populated when I call native.newTextField).  The only text fields the user ever sees are my fake fields.  The fake fields have touch listeners that give focus to the corresponding native text field and make what is typed in the native field appear in the fake field.  If I set “.isVisible = true” on the native text field right before calling “native.setKeyboardFocus( txtField )” everything works as normal.

What’s weird is I thought I had experimented with using .isVisible before, but apparently hadn’t tried setting it to “true” right before setting focus.  In any case, it’s working now.  You rock!  Thanks again!

Happy to help!  I’m glad it worked!

Yeah, when we fixed this issue, we noticed that this bug was caused by our “culling” routines in our rendering code where it would hide and not attempt to render objects that were offscreen.  While this makes sense for OpenGL rendered objects (it can provide a huge performance boost), it doesn’t make sense to do this for native objects such as text fields, web views, etc.  I saw a “flaw” in our culling of native objects which you’re now taking advantage of :slight_smile: .  The newest daily build fixes this issue by disabling culling of native fields, which is really the operating system’s job and shouldn’t be done by Corona.

Just to be clear. Is the right method to have textField on screen and isVisible = false now?

That seems to work for me (but have not tried on devices yet). I tried off screen and its not working in simulator (build 1168).

>> Just to be clear. Is the right method to have textField on screen and isVisible = false now?

That’s the work-around for those who do not have access to daily builds.  The newest daily build fixes this issue on Android.  I didn’t realize this was an issue on the Corona Simulator for Mac as well.  That’s the first I’ve heard this mentioned.

Personally I like the isVisible solution, seems clean but its not working in simulator.

Here are my finding:

If textField is isVisible = false and textField is ON screen then

Simulator = Success

Android = Fail

If textField is isVisible = true and OFF screen  then

Simulator = fail

Android = success

Would be great to try to make whatever solution universal.

@jonjonsson: Actually, I’m not sure what happens when the native text fields are on the screen. All of mine are off the screen the entire time. I use touch listeners on a graphic that looks like a text field. When the user touches the fake text field, keyboard focus goes to the corresponding native text field off screen, and the native keyboard comes up. When the user types, some on-screen text (display.newText) updates as the user types so that it looks like a real text field. The only thing missing really is a cursor, but it works well enough that I can live with that caveat.

I can’t remember what I saw in the simulator with this workaround. My original concern was for Android devices. You’re right though, it should work the same everywhere.

I’m a bit concerned that Apple review process will decline the app because its not native. Anyone have any info or thoughts on that?

@drewns: I’m doing exactly that. But yeah does not work for simulator.  

I did a workaround for cursor. Just a newLine that blinks and stops blinking when focus is not on hidden textField. The x location for the line is inputText.x + inputText.width and updated whenever you update the text.

Good idea for the cursor. I’ll have to give that a shot. I haven’t submitted my app yet, so I can’t provide any insight there.

@Joshua Are  you aware about changed behaviour for the input listener in iOS7? When you get the input.text on edit phase you do not get the letter that was just pressed, only he text excluding the letter that was just pressed. 

I can submit a bug report if needed if its not premature. 

I’m the Windows and Android developer here.  So, I’m not the best person to ask about iOS related issues.

But that said, if you think you’ve found a bug, then please submit a bug report.  That’s the best way to get issues on our radar.  Thanks.

Everyone,

The offscreen TextField issue is now fixed for the Mac version of the Corona Simulator as well.  This fix will be made available in daily build #1176.