xatkit-bot-platform / xatkit-chat-widget

(React) Chat widget for Xatkit
https://xatkit.com
MIT License
5 stars 2 forks source link

Auto scroll doesn't scroll to the bottom when displaying images #64

Open gdaniel opened 3 years ago

gdaniel commented 3 years ago

The scrolling will stop before the end of the conversation if some messages contain images. This is related to the way scrolling is implemented: we trigger a scrolling in Messages.componentDidUpdate(), but when the component is updated the image is still loading, and has a height of 0px until it's fully loaded. This means that the scrollHeight property value is wrong, and that helpers.scrollToBottom uses a wrong scroll offset.

Related resource