simple-chat
simple-chat copied to clipboard
Auto-Scroll to the latest chat on load
When the page loads for the first time, chat shows oldest messages first.
Is there any way to auto-scroll to the bottom, and show newest messages by default?
The chat code I use is:
{{>SimpleChatWindow
roomId="games"
username=profileName
avatar=(scProfilePic profileName)
showViewed=true
showJoined=false
publishChats=true
allow=true
placeholder="Type a message. Be nice :)"
It works fine in development, but fails to scroll in production.
My guess is, that there is some issue here: https://github.com/cesarve77/simple-chat/blob/master/window.js#L74-L92
Perhaps 50ms delay is not enough?
Sorry for the delay, i was on vacation.
I will work on that
2016-12-29 13:46 GMT+10:00 Netherdrake [email protected]:
It works fine in development, but fails to scroll in production.
My guess is, that there is some issue here: https://github.com/cesarve77/simple-chat/blob/master/window.js#L74-L92
Perhaps 50ms delay is not enough?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cesarve77/simple-chat/issues/8#issuecomment-269578029, or mute the thread https://github.com/notifications/unsubscribe-auth/ADyXp513CBLjfL2AGn_5AYJ8r7bnltJQks5rMy0MgaJpZM4LV_1L .
One question, what version of meteor do you use? I fix the problem, but Im not sure what if the version in atmophera is the same in github. in fact i dont think so,
Locally I have to repo, one for meteor 1.4 and other for meteor 1.2
Were on latest version, 1.4.2.3
Right now, we 'hacked' around the issue by doing jquery scroll 3 seconds after the page loads, however that doesn't work all the time, and as said, is very hacky.
The perfect hack is in the end of the window template put some helper: {{scroll}} and the helper is: scroll:()=>SimpleChat.scrollToEnd(Template.instance()) // here make the scroll ensure that the dom is colmplete rendered
I fixed but I have to make a big merge, I have time with out update the repo.
I will do this week.
2017-01-12 1:42 GMT+10:00 Netherdrake [email protected]:
Were on latest version, 1.4.2.
Right now, we 'hacked' around the issue by doing jquery scroll 3 seconds after the page loads, however that doesn't work all the time, and as said, is very hacky.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cesarve77/simple-chat/issues/8#issuecomment-271902507, or mute the thread https://github.com/notifications/unsubscribe-auth/ADyXp38Od2cwEja9w7aalRjh_lkVCMK0ks5rRPhggaJpZM4LV_1L .
Is there any way we can install or test the working version, or should we wait for the merge?
I guess @cesarve77 already resolved ths in window.js with https://github.com/cesarve77/simple-chat/blob/d866d3160b6a4ddb6283469cecf2792f499fbe36/window.js#L14