Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroller is not scrolling to the bottom when content has images #72

Open
weeliem opened this issue Apr 16, 2020 · 10 comments
Open

Scroller is not scrolling to the bottom when content has images #72

weeliem opened this issue Apr 16, 2020 · 10 comments
Assignees
Labels
Milestone

Comments

@weeliem
Copy link

weeliem commented Apr 16, 2020

Describe the bug
Scroller is not scrolling to the bottom when content has images.

To Reproduce
Steps to reproduce the behavior:
Add images(medium / large sizes) into vue-chat-scroll

Expected behavior
Completely scroll to bottom

Screenshots
https://prnt.sc/s07c7s

Additional context
This is probably due to vue-chat-scroll initialised before the images are completely loaded

@theomessin
Copy link
Owner

Hey, can I get a fiddle please (you may use this one as a base)?

@weeliem
Copy link
Author

weeliem commented Apr 17, 2020

Hi, you can try this here
https://jsfiddle.net/kanasaikuat/7qd3tmnb/1/

But try clear your browser history everytime u test it. Just to make sure you download the complete images from the links instead of using cache image.

@weeliem
Copy link
Author

weeliem commented Apr 17, 2020

I actually found someone is adding the extra image loaded event from your version.
https://github.com/SamuelLin/vue-chat-scroll-image

But the version does not included some features that you've added recently.

@theomessin
Copy link
Owner

theomessin commented Apr 17, 2020

I've been thinking of moving away from MutationObservers and using a ResizeObserver for Version 2. That would probably fix this. It would however require users to use the directive differently (see: https://rawgit.com/WICG/ResizeObserver/master/examples/chat.html). We'll see.

@theomessin
Copy link
Owner

We'll probably move to ResizeObservers. This will cause a breaking change as now the html will look like this (taken from WICG chat example):

<div class="chat">  <!-- chat has the scrollbar -->
  <div class="chat-text"> <!-- chat-text contains chat text -->
    <div>jack: hi </div>
    <div>jill: hi </div>
  </div>
</div

We might have to use: https://www.npmjs.com/package/resize-observer-polyfill

@theomessin theomessin added this to the v2.0 milestone Apr 23, 2020
@theomessin
Copy link
Owner

I'll be moving to ResizeObserver for version 2. That would fix this issue. Will implement this after I've moved to integration testing using Puppeteer.

@weeliem
Copy link
Author

weeliem commented Apr 23, 2020

Thanks @theomessin , can't wait to try on version 2 :)

@weeliem
Copy link
Author

weeliem commented May 4, 2020

HI @theomessin can i know when will you implement the version 2?

@theomessin
Copy link
Owner

HI @weeliem not sure at the moment. Pretty busy with other stuff

@theomessin
Copy link
Owner

I am very busy till the end of the month. Will try to pick this up in June

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants