Webgl Mobile Friendly Build - Issue with InputField (TMP)

I’m using the WebGL build on unity for my Convai-powered project, which I intend to make mobile-friendly. To facilitate interaction, I added a button that allows users to talk, and this functionality works fine. However, an issue arises when users prefer to type rather than talk. When they click on the TMP Input Field to type their message, the virtual keypad does not appear on mobile devices, making it impossible for users to type their input.

I’ve attempted to address this by manually triggering the virtual keyboard when the input field is selected, using TouchScreenKeyboard.Open. I added an onSelect listener for the TMP Input Field in the ‘ChatUI’ script, but it doesn’t seem to work in the WebGL build. Here’s the relevant code snippet:

_inputField = UIInstance.transform.Find(“Panel/InputField (TMP)”).GetComponent<TMP_InputField>();

if (_inputField != null)
{
inputField.onSelect.AddListener( => TriggerVirtualKeyboard());
}

private void TriggerVirtualKeyboard()
{
if (Application.isMobilePlatform)
{
TouchScreenKeyboard.Open(“”, TouchScreenKeyboardType.Default);
}
}

Despite the code implementation, the keypad either fails to show when the input field is selected or shows but is completely unattached, meaning when I type on it nothing comes up in the text input field. Does anyone have insights into why this might be happening in the WebGL build, or suggestions for alternative approaches to ensure mobile users can type their input?

Hello @Esther_Herbert,

Welcome to the Convai Developer Forum!

This issue appears to be more related to Unity and TextMeshPro rather than Convai. I recommend creating a post on the Unity Forum to get more targeted advice for this issue.

From my experience, this problem is often tied to the version of TextMeshPro being used. In one of my projects, I used TextMeshPro version 3.2.0-pre.8, which successfully triggered the virtual keyboard on WebGL mobile builds.

For other questions or detailed guidance on this, the Unity Forum will be a better platform, as this falls outside Convai’s support scope. Let me know if you need further assistance! :blush:

Thank you for getting back to me!
I’ll do so now

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.