Skip to content

Native Edit Box: creation/destruction of the native field is delayed on one frame #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Celtcoste opened this issue Mar 16, 2021 · 2 comments

Comments

@Celtcoste
Copy link

Hello !

I'm using the plugin and I noticed that there is a kind of blink when I'm disabling and enabling the native edit boxes.
There is below an example, which I took from my app at 3 following frames.

Frame 1:

Frame 2:

Frame 3:

I'm not using the functionality "Switch Between Native" because there is also a blink when focusing/defocusing the field. I think the delay/blink comes from the native call to Destroy(), that is not handle at the same time as the Unity onDisable() function on the input field.

To fix this issue, I tried to :

  • remove all the delays from scripts (WaitForEndOfFrame/WaitForFixedUpdate) so the native calls can be made the quickest possible
  • Prioritize the plugin script execution order (-800)
  • Drop down the framerate from 60 fps to 30 fps
  • Move the input field out of the canvas before its destruction and show it when it had time to load on the side

I'm currently using Unity 2020.3.0f1.
Is there a way to correct this problem in a proper way and avoid this delayed frame ?

Thank you for your help.

@nostek
Copy link
Owner

nostek commented Mar 16, 2021

Hi! Is this on ios or android ?
I've never seen the issue, but I'm only using this plugin on a project that is running Unity 2017.
The calls to the native code should be directly so in theory there shouldn't be any frame delays... but I do belive you.
I'm afraid I don't have a answer right now, but I'm planning on adding this to a Unity 2020 project soon(TM).

@Celtcoste
Copy link
Author

Celtcoste commented Mar 17, 2021

Thank you for your answer.

It happens on both. I also made the plugin compatible with TextMeshPro input but I’m not sure it’s related.

I did some tests, the delay appears when I am trying to move the native input. Unity elements are disappearing well but there is the one frame difference with native input.
Can it be related to the function CoUpdatePlacement?

I also notice when I use a native input inside a scroller, there is also a delay with other Unity UI elements.

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

No branches or pull requests

2 participants