Skip to content

Commit

Permalink
fix: chat "scrolling up" upon reaction
Browse files Browse the repository at this point in the history
...resulting in new messages not getting scrolled into view
when they arrive.

This simply removes height changes between messages with / without
a reaction.

Closes #3753
  • Loading branch information
WofWca committed Sep 18, 2024
1 parent 2b9e461 commit cf84e72
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- fix: wrong translation string for new group creation #4126
- fix: packaging: windows 64bit and 32bit releases now have different filenames, bring back 64bit windows releases. #4131
- some shortcuts (e.g. `Ctrl + N`, `Ctrl + K`) not working on some languages' keyboard layots #4140
- fix chat "scrolling up" when someone adds a reaction, resulting in new messages not getting scrolled into view when they arrive #4120

<a id="1_46_8"></a>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
cursor: pointer;
margin-right: 10px;
position: relative;
top: 20px;
line-height: 1; // So that it doesn't change the message height.
top: 16px;
}

.emoji {
Expand Down
24 changes: 15 additions & 9 deletions packages/frontend/src/components/message/styles.module.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
$reaction-transition-duration: 100ms;
// $reaction-transition-duration: 100ms;

.message {
transition: margin-bottom ease-out $reaction-transition-duration;
&.withReactions {
margin-bottom: 10px;
}
// Commented-out for now because of
// https://github.com/deltachat/deltachat-desktop/issues/3753
// (i.e. adding a reaction would change the height of the message,
// which would make the chat "scroll up", and so new messages would not
// get automatically scrolled into view).
//
// transition: margin-bottom ease-out $reaction-transition-duration;
// &.withReactions {
// margin-bottom: 10px;
// }
}

.messageFooter {
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
transition: margin-bottom ease-out $reaction-transition-duration;
// transition: margin-bottom ease-out $reaction-transition-duration;

&.onlyMedia {
bottom: 0;
Expand All @@ -21,9 +27,9 @@ $reaction-transition-duration: 100ms;
right: 0;
}

&.withReactionsNoText {
margin-bottom: 10px;
}
// &.withReactionsNoText {
// margin-bottom: 10px;
// }
}

.startWebxdcButton {
Expand Down

0 comments on commit cf84e72

Please sign in to comment.