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

autofoucs issue in android #13

Open
swaroopa94 opened this issue Dec 28, 2018 · 2 comments
Open

autofoucs issue in android #13

swaroopa94 opened this issue Dec 28, 2018 · 2 comments

Comments

@swaroopa94
Copy link

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",

@Gri22ly
Copy link

Gri22ly commented Jan 30, 2019

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 )

@ShawSmall
Copy link

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)

}

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

No branches or pull requests

3 participants