React-native-gifted-chat: Question: When enter a chat, is that possible to start at the top of the chat history?

Created on 1 Nov 2017  Â·  4Comments  Â·  Source: FaridSafi/react-native-gifted-chat

Right now when a user enters gifted chat screen, the chat will be at the end of all chat history, aka at the bottom of the scrollView. Is there a way to let the chat starts at the top of all the chat histories? Or scroll to top when the component is initialized?
Thanks in advance!

wontfix

Most helpful comment

find MessageContainer.js (node_modules/react-native-gifted-chat/src/MessageContainer.js),add flexDirection: 'row',alignItems: 'flex-start'

const styles = StyleSheet.create({
container: {
flex: 1,
+ flexDirection: 'row',
+ alignItems: 'flex-start'
}
If there is a better way, you can communicate

All 4 comments

find MessageContainer.js (node_modules/react-native-gifted-chat/src/MessageContainer.js),add flexDirection: 'row',alignItems: 'flex-start'

const styles = StyleSheet.create({
container: {
flex: 1,
+ flexDirection: 'row',
+ alignItems: 'flex-start'
}
If there is a better way, you can communicate

it is better than another way of ' contentContainerStyle: {'flexGrow': 1, 'justifyContent': 'flex-end'} '

@xcarpentier could you not add these style changes as part of the inverted prop fix?
The suggestion made by @lfh22 seems to fix the various open 'start at top' bugs / issues currently open, such as mine: https://github.com/FaridSafi/react-native-gifted-chat/issues/666

Adding this fix would presumably close a bunch of those.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

radvc picture radvc  Â·  3Comments

inceptivetech picture inceptivetech  Â·  3Comments

maharjanaman picture maharjanaman  Â·  3Comments

redwind picture redwind  Â·  3Comments

xcxooxl picture xcxooxl  Â·  3Comments