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

Suggestion: Implement wrapper to avoid crashes on other platforms #17

Open
blaues0cke opened this issue Jan 4, 2018 · 3 comments
Open

Comments

@blaues0cke
Copy link

I just added the following code in my RN app that runs on iOS and Android:

AndroidKeyboardAdjust.setAdjustPan();

But to make it work on iOS I have to check if AndroidKeyboardAdjust

if (AndroidKeyboardAdjust) {
    AndroidKeyboardAdjust.setAdjustPan();
}

Would be nice to get this wrapped so that

AndroidKeyboardAdjust.setAdjustPan();

just does nothing (without crashing) on iOS.

@DanielZara
Copy link

Or you can check platform:
isAndroid() && AndroidKeyboardAdjust.setAdjustNothing();

@blaues0cke blaues0cke changed the title Suggestion: Implement wrapper to avoid crashes on othere platforms Suggestion: Implement wrapper to avoid crashes on other platforms May 29, 2019
@blaues0cke
Copy link
Author

@DanielZara Yes, but this still leads in code that nobody should write :-)

@DanielZara
Copy link

@blaues0cke I agree, but we could only endeavor ;)

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

2 participants