Giter VIP home page Giter VIP logo

Comments (9)

KornyAS avatar KornyAS commented on May 22, 2024 2

SOLVED

If someone has the same bug, try to replace method OnEnable() from

private void OnEnable () {
    if (_isMobileInputCreated) {
        this.SetVisible (true);
    }
}

to

private void OnEnable () {
    base.Start();
    StartCoroutine(InitialzieOnNextFrame());
}

and also replace method OnDisable() from

private void OnDisable() {
    if (_isMobileInputCreated) {
        this.SetFocus (false);
        this.SetVisible (false);
    }
}

to

private void OnDisable() {
    RemoveNative();
}

It will work for everyone, just make sure that you make _inputObjectText.FontSize multiplication by ratio just once.
For instance, create a bool variable and make like this:

if (isFirstTime) {
    isFirstTime = false;
    _config.FontSize = ((float)_inputObjectText.fontSize) * ratio;
} else {
    _config.FontSize = ((float)_inputObjectText.fontSize);
}

from umi.

KornyAS avatar KornyAS commented on May 22, 2024
  • Noticed just right now that if you open notification panel - InputField will dissapear and you have to disable and enable InputField parent to make it visible. But it happens very rarely.

from umi.

mopsicus avatar mopsicus commented on May 22, 2024

There are many different cases with visibility, so you have to control visibility of inputfields by yourself. When application lost focus hide it and show when it return to user. There are special method for that SetVisible.

from umi.

KornyAS avatar KornyAS commented on May 22, 2024

Yes, I tried, I tried also make it visible in Update but unsuccessfully. It just stay invisible while I execute SetVisible(true) in Update.

from umi.

KornyAS avatar KornyAS commented on May 22, 2024

So, any idea how to fix it?

from umi.

mopsicus avatar mopsicus commented on May 22, 2024

I don't know..
I guess, this is architecture issue of your app, and no plugin

from umi.

Shantibhushan95 avatar Shantibhushan95 commented on May 22, 2024

Had same issue with DontDestroyOnLoad UI panels. @Almazikman's solution worked, but the overlay inputfield wasn't disappearing when I closed the panel after opening it more than once in different scenes. I added following public member which is called only for DontDestroyOnLoad panels, this is working now.

public void SetCustomVisibilityOff()
{
	if (_isMobileInputCreated)
	{
		this.SetFocus(false);
		this.SetVisible(false);
		RemoveNative();
	}
}

from umi.

ajathunity3d avatar ajathunity3d commented on May 22, 2024

Had same issue with DontDestroyOnLoad UI panels. @Almazikman's solution worked, but the overlay inputfield wasn't disappearing when I closed the panel after opening it more than once in different scenes. I added following public member which is called only for DontDestroyOnLoad panels, this is working now.

public void SetCustomVisibilityOff()
{
	if (_isMobileInputCreated)
	{
		this.SetFocus(false);
		this.SetVisible(false);
		RemoveNative();
	}
}

From where you're calling this method??

from umi.

Shantibhushan95 avatar Shantibhushan95 commented on May 22, 2024

I added this method as a public member of MobileInputField.cs and am calling the method from a script attached to the DontDestroyOnLoad ui panels containing an inputfield whenever the panel needs to be closed.

from umi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.