question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Keyboard event event.key is unidentified

See original GitHub issue

Bug description: I have a texteditor ( quill.js ) in my webview, and there is a bug in it, enter ( new line ) does not change text focus

I try to figure out what is the problem and add ‘keydown’ event to a custom div with content-editable. and after that I see the value of event.key is unidentified for all input

To Reproduce: Try load webview with this html

<div
      tabindex="1"
      contenteditable="true"
      id="test-test"
      style="width: 300px; height: 300px;"
    ></div>
    <script>
      document
        .getElementById("test-test")
        .addEventListener("keydown", function (e) {
          alert(e.key || e.keyCode || "empty");
        });
    </script>

Expected behavior: event.key or event.keyCode has value

Screenshots/Videos: image

Environment:

  • OS: android
  • OS version: android 9
  • react-native version: 62.2
  • react-native-webview version: 10.3.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
github-actions[bot]commented, Aug 21, 2020

Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically

0reactions
aliakbarazizicommented, Aug 26, 2021

After a research i figure out this is not bog for react native webview, its for os or maybe chrome ( actualy there is fight here https://bugs.chromium.org/p/chromium/issues/detail?id=118639 ) so this is not going to fix because of they are blaming each other!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keyboard event event.key is unidentified on android webview
The is a deliberate decision from the Android touch keyboard implementation. The only workaround is dealing the actual input text: inputElement.
Read more >
event.key = Unidentified, event.keyCode = 229 #14512
I just listen to the input 's 'keydown' event through the onKeyDown and print what key I've pressed. In chrome, the key is...
Read more >
KeyboardEvent.key - Web APIs | MDN
The KeyboardEvent interface's key read-only property returns the value of the key ... A keyup event is fired once the key is released....
Read more >
Virtual Keyboard event.key=Unidentified - Ignition
I am trying to capture the onKeyDown event and use the key the user pressed, but when using chrome on android the key...
Read more >
Keyboard: keydown and keyup
The keydown events happens when a key is pressed down, and then keyup – when ... keyCode should be 229 and e.key should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found