Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyboardEvent::key() and code() don't work in wasm-bindgen 0.2.41 in Firefox #1436

Closed
nstoddard opened this issue Apr 11, 2019 · 1 comment
Closed
Labels

Comments

@nstoddard
Copy link
Contributor

Describe the Bug

In wasm-bindgen 0.2.41, KeyboardEvent::key() and ::code() always return the empty string. In 0.2.40 they worked fine. I'm not sure whether this bug is in wasm-bindgen, web-sys, or another related crate.

Steps to Reproduce

  1. Compile and run https://github.com/nstoddard/webgl-gui-demo
  2. Press one of the arrow keys

Expected Behavior

The arrow keys should move the diamond in the middle.

Actual Behavior

The arrow keys do nothing. If logging of pressed_keys is added to Demo::handle_pressed_keys, it shows that the keys are always empty strings (they should be "ArrowLeft" or similar).

Additional Context

I can only repro this in Firefox, not Chrome. I'm using Linux; I don't know if it happens on other platforms.

If you downgrade the wasm-bindgen dependency to 0.2.40 (which also requires downgrading some dependencies in webgl-wrapper and webgl-gui) the arrow keys work.

@nstoddard nstoddard added the bug label Apr 11, 2019
alexcrichton added a commit to alexcrichton/wasm-bindgen that referenced this issue Apr 11, 2019
The last write accidentally wasn't accounted for in the returned length
of the string and we unfortunately don't have any test coverage of
`encodeInto` since it requires Firefox nightly right now (and doesn't
work in Node yet).

Closes rustwasm#1436
@alexcrichton
Copy link
Contributor

Thanks for the report! Looks like this is an accidental regression from #1414 (cc @RReverser ) which shoudl be fixed in #1442

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants