TextMeshPro Input Field + new Input System + WebGL = no work

The TextMeshPro input textfield does not seem to be working in WebGL. I created a bare-bones new project to test as well, and it still doesn’t work. All you have to do is create a text mesh pro input field, set your build to use just the “new” input system, and publish for WebGL. The cursor will go into the textfield and display the blinking caret, but when you type it will not display any text. The “onSubmit” seems to still get called when you press enter on the keyboard though, it’s just that no text will display in the textfield when you type. Everything works fine in the editor, but not when published to WebGL.

I am using the latest text mesh pro, “preview 14, 2.1.0” as well as the newest version of the Input System.

I also made sure that the event system is using the new “Input System UI Input Module (script)”.

Unity version is 2019.4.1f1.

1 Like

I’m having the same issue… any more information or resolutions on this? I also tried a regular text input (Non-TextMeshPro) and did not get any keyboard input. Again, this is only for WebGL. Everything works fine for PC mode

Please make sure that you submit a bug report so the New Input System team can address this.

I went ahead and made a bug report. I’ll post a link when it’s finished going through. I believe also related to this, is the ScrollRect and mouse wheel. Scroll rect’s scroll extremely slow in WebGL when using the new input system.

Ok, here is a bug report on the issue tracker. If you could vote on it or comment on it here, perhaps it will help move it forward. Unity Issue Tracker - [New Input System] Keyboard input is not detected in the Input Field when built on WebGL

2 Likes

I have the same problem so I added my vote to the issue, along with some comments with what I am seeing. I’ll duplicate that info here:

I am using these versions:

  • Unity 2019.4.6f1
  • “com.unity.textmeshpro”: “2.1.1”,
  • “com.unity.inputsystem”: “1.0.0”,

Nothing that I type shows up in the input field (no letters or numbers even from the numpad), but arrow and home/end keys do move the cursor around so I know the field has focus.

@therobby3 mentioned on the issue that they are also having trouble with scrolling being really slow, both the mouse scroll wheel and using ScrollRect’s in-game. I have also experienced that issue and worked around it in my camera controller with the following code:

float zoom = inputActions.Camera.CameraZoom.ReadValue<float>();
#if UNITY_WEBGL && !UNITY_EDITOR
zoom *= 100f;
#endif

I had the same issue, and found out that it is probably due to the input fields still using the old input system. I fixed it by going to Edit → Project settings → Player → WebGL Settings → Other Setting → Active Input Handling and setting that option to “Both” instead of “Input System Package (New)”

4 Likes

Thanks mate you made my day. Had the same issue and setting to both solved it :slight_smile:

I do not believe this issue is fixed. Setting the input handling to “both” is a workaround, but it shouldn’t be needed since the new input system is now considered stable.

However, TextMeshPro does not work at all via the new Input System when building for WebGL on the latest version of Unity 2020.2.

1 Like

What version of the TMP package are you using?

TextMeshPro Version 3.0.4 and Unity 2020.2.6f1 (the latest)

I still have issues with this in Unity 2020.2.5f1 and 2020.3.3f1. I created a bug report with ID: 1329319_vrhtckbumg8phfu5

Setting the input handling to “both” does indeed fix it, but I prefer to only use the new system.

1 Like

Same issue on 2020.3.4f1 and input system 1.0.2 tmp 3.0.6

EDIT: workaround of using “both” worked for me as well.

Had the same issue on 2021.3.18f1 with input system 1.4.4 and tmp 3.0.6 on OSX Ventura 13.0.1

Workaround did not work for me.

However I noticed when I created a new scene the EventSystem was missing. Only Main Camera and Directional Light were in the new scene. Copy paste from the previous scene did the trick. Actually it works well with the new input system. No need to have Both enabled.

For anyone still experiencing this, you can get a workaround here GitHub - kou-yeung/WebGLInput: IME for Unity WebGL
This works with only the new input system active.

Still present in the latest LTS to this day… TMP_InputField simply doesn’t open keyboards on Android…

1 Like

Yes, doesn’t work on Android too. The keyboard input just shows a glimpse and closes quickly on its own.

in case anyone was interested, I used the package styno333 suggested, but it didn’t work as expected and had quite a lot of bugs for a production game. So, I ended up using the legacy Input component which worked as expected and haven’t encountered a bug since; As such, I recommend giving the legacy input a try if you value the polishness of your game enough to spend time refactoring all the input fields.

For me, I had just refactored from old Input to the new one which improved touch performance significantly. But now this inputfield bug has caught me off guard between releases. And for Android [Both] Inputs is not advised.

EDIT: Welp, [Both] Inputs too didn’t fix the InputField.