Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Text field disappear in some situations #55

Open
andyleekp opened this issue Nov 19, 2017 · 4 comments
Open

Text field disappear in some situations #55

andyleekp opened this issue Nov 19, 2017 · 4 comments

Comments

@andyleekp
Copy link

I found that there is a problem in mobile environment.

In some kind of situations such as sliding the task/navigation bar or switching other apps and go back my app again on Andriod or iOS, all the text fields in the input fields which attached with the script of "Native Edit Box" has gone. But when I reload the scene or set the game object to inactive and active again, the text fields appears again!

Is there any missing thing in the script or we can do so that to fix this problem? I think the text fields actually are still here but just go somewhere, may be out of camera or something? Thanks for attention~

@bthdimension
Copy link

bthdimension commented Jan 19, 2018

The same thing happens to me on Android and on iOS after a lot of switching between apps. Did you ever find a solution for the issue?

@andyleekp
Copy link
Author

Yes, we can use OnApplicationFocus and OnApplicationPause to fix/make the native text field appear again.

When we switch between apps or slide the status bar on the top of iOS/Android, the status of our app is "PAUSED" and OnApplicationPause will be called at the moment. Therefore, we can just set the native input field object to inactive (setActive(false)) in OnApplicationPause. When we switch back to our app, OnAppliactionFocus will be called again and we can set the native input field object to active (setActive(true)) again. The input text field will appear again.

@bthdimension
Copy link

Thanks, I'll try that :-)

@Nezz
Copy link
Member

Nezz commented May 24, 2018

We are using a method similar to what @andyleekp described, but only with OnApplicationFocus. Feel free to contribute by submitting a pull request which integrates this into the plugin.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants