emscripten-core / emscripten-core/emscripten

The generated JS steals all keyboard events from focused text input fields

Open
#19,138 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Hi,

I have a page with a wasm binary and a text input field as well (see it [here](https://bztsrc.gitlab.io/meg4/)).

Problem description: no matter what I do, I cannot enter text into the input field, because the emscripten generated JS steals all events all the time.

How to produce:
1. click on the "Search" input field below the big canvas
2. you'll see that it gets focused, so it should get keyboard events
3. now try to type anything, it won't work
4. try pressing F1 while the search input is focused. You'll see the wasm controlled canvas changing, meaning despite the input field is focused, the wasm binary got the keypress event.

This issue affects Firefox (multiple versions, including the latest), not sure about other browsers. But the way how the generated JS looks like, I assume others are affected too.

How can I stop the wasm binary getting the keyboard events when an input field on the same page is focused? Is there a command lien switch or whatever to influence the emscripten generated JS?

Cheers,
bzt

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.