-
-
Notifications
You must be signed in to change notification settings - Fork 171
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: chat not being scrolled to bottom (images) #4406
Conversation
5bb3710
to
af0c8a4
Compare
Closes #4404. The bug was introduced in db83279. Prior to that all attachments had a fixed height of 200px. This should also eliminate layout shifting when scrolling the chat, and when new messages arrive. An alternative solution that would still have layout shifting, but at least keep the chat "anchored" to bottom would be #3753 (comment), but it's not supported well by browsers. Co-authored-by: Max Philippov <[email protected]>
af0c8a4
to
1d2508f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and solves the problem!
return { | ||
height: | ||
message.dimensionsHeight > 0 && message.dimensionsHeight < 100_000 | ||
? message.dimensionsHeight |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we have a limit of 100_000 here? Would 10_000 not be enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably. But it's just a sanity check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe someone has 4 4K monitors stacked on top of each other on their wall 🤷♀️
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this needs more investigation... :-(
OK, I'll close this and let's continue the discussion in the relevant issue. |
Closes #4404.
The bug was introduced in db83279.
Prior to that all attachments had a fixed height of 200px.
This should also eliminate layout shifting when scrolling the chat,
and when new messages arrive.
An alternative solution that would still have layout shifting,
but at least keep the chat "anchored" to bottom would be
#3753 (comment),
but it's not supported well by browsers.
I tested it, and verified that images have proper dimensions now even before they get displayed, and that it wasn't the case prior to this MR.