Skip to content
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

HTML element is not hidden after deselecting input field #164

Open
azbiusta opened this issue Jul 29, 2024 · 0 comments
Open

HTML element is not hidden after deselecting input field #164

azbiusta opened this issue Jul 29, 2024 · 0 comments

Comments

@azbiusta
Copy link

I am develoing a mobile webgl game. When using input fields, the plugin automatically opens keyboard and enable me to type into the input field. It also creates an input field element at the bottom of the screen.

The newly created element does not disappear even after deslecting the input field. I tried to modify GetElementRect()

RectInt GetElemetRect()
{
    var rect = input.GetScreenCoordinates();
    // モバイルの場合、強制表示する
    if (showHtmlElement || Application.isMobilePlatform)
    {
        var x = (int)(rect.x);
        var y = (int)(Screen.height - (rect.y + rect.height));
        //return new RectInt(x, y, (int)rect.width, (int)rect.height);
        //return new RectInt(x, y, 0, 0);
        return new RectInt(-9999, -9999, 0, 0);
    }
    else
    {
        var x = (int)(rect.x);
        var y = (int)(Screen.height - (rect.y));
        //return new RectInt(x, y, (int)rect.width, (int)1);
        //return new RectInt(x, y, 0, 0);
        return new RectInt(-9999, -9999, 0, 0);
    }
}

This removed the unwanted html input field, but if I use any input fields, the game becomes unplayable because clicking the buttons at the bottom of the screen selects an invisible input field that I cannot deselect.

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

1 participant