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.

Android: Issue when displayed in Modal

See original GitHub issue

There is an issue with the keyboard/height adjustments when displaying the component in a Modal.

It can be reproduced with the following simple render code:

<Image source={{ uri: 'http://cdn.pcwallart.com/images/dark-gradient-tumblr-wallpaper-1.jpg'}} style={{ flex: 1 }}>
  <GiftedChat />
</Image>

This renders the following:

When focusing the TextInput, the component correctly resizes and positiones the input bar:

However when the code above is wrapped in a <Modal> .. </Modal> the following happens when focusing the TextInput:

There are no issues on iOS.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
pfeiffercommented, Aug 16, 2016

Actually, digging through the react-native code I see that Modal on Android is implemented as Dialog.

The issue is that adjustResize isn’t being applied to the Dialog that displays the modal. This can be fixed by adding the following to res/values/styles.xml:

<style name="Theme.FullScreenDialog">
     <item name="android:windowSoftInputMode">adjustResize</item>
</style>

Might be worth adding to the README 😃

1reaction
FaridSaficommented, Aug 16, 2016

Thank you, I will add in readme

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap Modal not displaying correctly on Android Webview
I'm currently using Titanium SDK to use a webview that displays my remote website. The website has a twitter-bootstrap modal/popup on it.
Read more >
Problem with modal window on Android mobile - DataTables
Click on 'click to show deal'. The popup window on Android shows way down the screen and is not scaled to the width...
Read more >
Dialogs - Android Developers
AlertDialog: A dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout.
Read more >
Modal DIALOG does not interact well with Android 4.4 KitKat ...
This is an omnibus bug report rolling up a few issues. We want to track an end-to-end modal dialog scenario. Plus the issues...
Read more >
The Dialog element - HTML: HyperText Markup Language
When the open attribute is not set, the dialog shouldn't be shown to the user. It is recommended to use the .show() or...
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