GetStream / stream-chat-react-native

💬 React-Native Chat SDK ➜ Stream Chat. Includes a tutorial on building your own chat app experience using React-Native, React-Navigation and Stream
https://getstream.io/chat/sdk/react-native/
Other
977 stars 326 forks source link

Empty bottom sheet shown while the app resumes from the background #2663

Closed andreicrat closed 1 month ago

andreicrat commented 2 months ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch stream-chat-react-native-core@5.36.2 for the project I'm working on.

We've seen a strange behavior that an empty bottom sheet has been displayed after the app resumed from the background with a different orientation.

Steps to reproduce:

  1. Use the chat display threads
  2. Put the app in landscape mode
  3. Put the app in the background
  4. Put the phone in portrait mode again and open the app - you'll see an empty bottom sheet of the attachments picker.

Here is the diff that solved my problem:

diff --git a/node_modules/stream-chat-react-native-core/src/components/AttachmentPicker/AttachmentPicker.tsx b/node_modules/stream-chat-react-native-core/src/components/AttachmentPicker/AttachmentPicker.tsx
index 2399593..4d46a64 100644
--- a/node_modules/stream-chat-react-native-core/src/components/AttachmentPicker/AttachmentPicker.tsx
+++ b/node_modules/stream-chat-react-native-core/src/components/AttachmentPicker/AttachmentPicker.tsx
@@ -264,7 +264,7 @@ export const AttachmentPicker = React.forwardRef(
     return (
       <>
         <BottomSheet
-          containerHeight={fullScreenHeight}
+          // containerHeight={fullScreenHeight}
           enablePanDownToClose={true}
           handleComponent={
             /**

This issue body was partially generated by patch-package.

khushal87 commented 2 months ago

Hey @andreicrat, do you see how containerHeight would cause a problem here?