Home > Software engineering >  React-native hide numeric keyboard on API respond
React-native hide numeric keyboard on API respond

Time:01-16

I have a react native compnent that shows a popup message at the bottom of my mobile screen with data from my API http request. Trying to hide the numeric keyboard to be able to see the popup that is behind the keyboard. Calling keyboard.dismiss() when the API response comes does nothing.

Expecting keyboard to be dismissed while using import { Keyboard } from 'react-native' and calling the keyboard.dismiss() from the API response.

CodePudding user response:

You are calling keyboard.dismiss() from an async () method, that's why the keyboard is not hiding. You will have to call keyboard.dismiss() from the main thread.

  • Related