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 events not working on Android

See original GitHub issue

RN 0.36, Samsung Galaxy S6 running Android 6.0.1.

componentDidMount() {
    this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
    this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
}

Logging in those methods, I can see that they are called on iOS, but not Android. I’ve read all the other issue threads regarding this but most of them are old at this point. I’ve added android:windowSoftInputMode="adjustResize" to my manifest. What am I missing?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
z4ph0rdcommented, Apr 21, 2017

i still cannot get the event working on RN42,

    componentDidMount(){
        this.kbe = Keyboard.addListener('keyboardDidShow', this.showMessage);
    }
   showMessage =()=> {
       alert('keyboardup');
    }

1reaction
RyanMitchellWilsoncommented, Feb 15, 2018

Still an issue with react-native 0.50.0, is this being worked on? Can this be reopened?

Read more comments on GitHub >

github_iconTop Results From Across the Web

keyPress event not firing in Android mobile - Stack Overflow
I am using backbone,marionette for my Application.I used same code for both desktop and mobile but keypress not working in mobile .I made...
Read more >
Key events don't work properly on Android Chrome ... - GitHub
I've been trying substance (latest dev), and noticed that the key events or something aren't properly firing on android chrome, which causes ...
Read more >
Handle keyboard actions - Android Developers
Handle single key events. To handle an individual key press, implement onKeyDown() or onKeyUp() , as appropriate. Usually, you use ...
Read more >
keydown and keyup events do not have proper keyCode (it's ...
Steps to reproduce: 1. Load the attached HTML file in Chrome for Android. 2. Click on the input element. 3.
Read more >
Javascript to detect Enter key press in Mobile App | OutSystems
For simply detecting the "enter" key it seems that it is a bit simpler. The Input Widget Event property, when set to onkeyup...
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