react-native-yusha-customKeyboard
react-native-yusha-customKeyboard copied to clipboard
autofoucs issue in android
Hi
I am using this module and its working great but the issue is
when I keep autofocus to the textInput in iOS working fine but in android it is getting the default keyboard again when we click on the textInput then it shows the custom keyboard.
Can you tell me how to solve this I used same code as in RNdemo project
React-Native : 0.57.1 react-native-yusha-customkeyboard: "^0.1.3",
Hi @swaroopa94 ! Thank you for using this module and your feedback. The issue is with the Android custom keyboard. Because React Native's will invoke API to display the default keyboard when the TextInput component is focused. In my code https://github.com/lyxia/react-native-yusha-customKeyboard/blob/master/android/src/main/java/com/facebook/react/uimanager/RNCustomKeyboardModule.java#L75 , it will listen to the focus event and hide the default keyboard. Thus there might be some time lag between the the default keyboard hiding and the custom one popping out. Currently I don't have any better solutions to resolve this issue. If you have any ideas, please tell me and pull requests are always welcome and appreciated :) (Reply by @lyxia )
componentDidMount() { this.installTime = setTimeout(()=>{ install(findNodeHandle(this.input), this.props.customKeyboardType);
if(Platform.OS === 'android') {
this.showSub = addKeyBoardShowListener(this._showKeyboard);
this.hideSub = addKeyBoardHideListener(this._hideKeyboard);
}
AppState.addEventListener('change', this._handleAppStateChange);
this.input && this.input.focus();
}, 300)
}