Skip to content

HTML Inputfield can have wrong size and position when window is resized or zoomed in. #191

@StefanStrategis

Description

@StefanStrategis

Suggestion:

Recalculate and apply Input rect on WebGLWindowPlugin.WebGLWindowOnResize()

Can be achieved by calling DeactivateInputField WebGLWindowPlugin.WebGLWindowOnResize.

        private void Awake()
        {
            input = Setup();
#if !(UNITY_WEBGL && !UNITY_EDITOR)
            // WebGL 以外、更新メソッドは動作しないようにします
            enabled = false;
#endif
            // for mobile platform
            if (Application.isMobilePlatform)
            {
                if (input.EnableMobileSupport)
                {
                    gameObject.AddComponent<WebGLInputMobile>();
                }
                else
                {
                    // when disable mobile input. disable self!
                    enabled = false;
                }
            }

            WebGLWindow.OnResizeEvent += DeactivateInputField;
            OnKeyboardDown += KeyboardDownHandler;
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions