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

Fix thread jumping when embeds load #166

Open
jamesnvc opened this issue Sep 12, 2018 · 5 comments
Open

Fix thread jumping when embeds load #166

jamesnvc opened this issue Sep 12, 2018 · 5 comments

Comments

@jamesnvc
Copy link
Contributor

jamesnvc commented Sep 12, 2018

Regression, presumably from when the logic for thread scrolling changed.

If one switches to a group with a long thread that has links in it, they'll see it starts scrolled to the bottom as expected, but then as the link previews load, the height changes & they end up scrolled up somewhat.

@jamesnvc
Copy link
Contributor Author

There's a proposed change to add a resize observer which would be very useful for this, without needing weird hacks to figure out when things have loaded or whatever https://github.com/w3c/csswg-drafts/blob/master/resize-observer-1/explainer.md#example-keeping-chat-window-scrolled-to-the-bottom

@rafd
Copy link
Member

rafd commented Jan 24, 2019

We're already using a ResizeObserver polyfill: https://github.com/braidchat/braid/blob/master/src/braid/core/client/ui/views/thread.cljs#L112

@jamesnvc
Copy link
Contributor Author

Ah, oops. I guess maybe the polyfill doesn't handle the size changing in the way it is here properly then? 😕

@rafd
Copy link
Member

rafd commented Jan 24, 2019

I think I introduced ResizeObserver when fixing the "jumping textarea" issue, which may have regressed the scroll-to! behaviour.

@jamesnvc
Copy link
Contributor Author

Looking at the events that are being sent, it does look like some resizes aren't actually being observed properly, so maybe the polyfill just isn't sufficient yet.

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

No branches or pull requests

2 participants