FaridSafi / react-native-gifted-chat

πŸ’¬ The most complete chat UI for React Native
https://gifted.chat
MIT License
13.53k stars 3.55k forks source link

The scroll view for messages cuts off exactly where the content ends. #2485

Open bhavya-saurabh opened 8 months ago

bhavya-saurabh commented 8 months ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-gifted-chat@2.4.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-gifted-chat/lib/MessageContainer.js b/node_modules/react-native-gifted-chat/lib/MessageContainer.js
index 6bdf6da..17f82e8 100644
--- a/node_modules/react-native-gifted-chat/lib/MessageContainer.js
+++ b/node_modules/react-native-gifted-chat/lib/MessageContainer.js
@@ -12,6 +12,7 @@ const styles = StyleSheet.create({
         flex: 1,
     },
     containerAlignTop: {
+        flex: 1,
         flexDirection: 'row',
         alignItems: 'flex-start',
     },

This issue body was partially generated by patch-package.

Description:

The scroll view for messages cuts off exactly where the content ends.

Expected Behavior: When scrolling, screen should cut off right above the text input.

Current Behavior: When scrolling, screen cuts off where the content ends.

bug:

https://github.com/FaridSafi/react-native-gifted-chat/assets/109980978/36685bf7-9d74-4799-aae6-7092901de29e

solution:

https://github.com/FaridSafi/react-native-gifted-chat/assets/109980978/6a01ce2a-68f2-4a54-938d-fe3a6fa976f2

andrewoodleyjr commented 3 months ago

@bhavya-saurabh It looks like the specific code you mentioned isn't the solution. flex: 1 didn't work for me. Maybe it something else in the patch that's making it work based on my tests.