lukejacksonn / react-slack-clone

Complete chat application, built with Chatkit | by @lukejacksonn
https://pusher.com/chatkit
MIT License
1.35k stars 262 forks source link

Bug. Scrollbar does NOT update when images are present #70

Open neuropass opened 5 years ago

neuropass commented 5 years ago

I just noticed an issue. If you post an image the scrollbar position is not updating. Does not synch to the bottom. This issue is not present with regular text messages.

What does it do that with images only? What would be the possible fix for this behavior? @lukejacksonn

Thanks!

lukejacksonn commented 5 years ago

Hey! Yes this is a known issue.. so the problem is how to know when to scroll (that is, not when the images has been appended to the DOM but when the image been rendered in the list, loaded and taken shape). I played around for a long time trying to find a solution that works for all cases and ina ll browsers but really struggled!

Perhaps adding a call to this action https://github.com/pusher/react-slack-clone/blob/master/src/index.js#L150 inside an onload function on these elements https://github.com/pusher/react-slack-clone/blob/master/src/components/Message/index.js#L25 might work out.. I'm sure I tried it but not can't remember now.