Cannot paste text into Text Box in HTML5 build

I can’t paste text from the Windows clipboard into any UMG Text Boxes in an HTML5 build. The paste option is grayed out if I right click the Text Box in both Chrome and Firefox. Ctrl + V does nothing in Chrome and in Firefox it just types ‘v’ into the Text Box. Pasting works just fine in PIE and Windows64 build.

Steps to reproduce:

  1. Create a new project
  2. Add a UMG Text Box widget to the HUD
  3. Build for HTML5
  4. Try pasting any text into the Text Box in a running HTML5 build in Chrome or Firefox

Hello,

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here

You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

This seems to be a current limitation with input handling on the HTML launch page.

It may be possible to work around this/implement it manually by implementing a paste handler (onpaste Event) on the page, and inject the results as individual characters. Something like that is what a proper fix will involve doing as well, since the HTML page will need to register to browser’s paste events (in order to get data from the “real” operating system clipboard)

Looks like this was acknowledged already, so hopefully will get on the development queue soon.

juj, is the SDL layer still tripping this up? or, should we implement a copy and paste listener like you suggested above? this seems like a really quick thing to whip up.

Sorry for the delay in replying Nick, was on a long Christmas vacation.

Check out Multithreading 15/N: Synchronous stdio by juj · Pull Request #6082 · emscripten-core/emscripten · GitHub with the ‘paste’ handler, that implements a copy-paste handler to a text area. I can’t immediately recall off the top of my head how SDL will behave here, but a similar approach could be used, except that Module.writeStdin() does not (yet at least) exist for SDL, since that PR is only for multithreaded ASMFS.