Skip to content

Commit

Permalink
style: avoid horizontal scrollbars in chat list
Browse files Browse the repository at this point in the history
The bug was likely introduced in 0e0d0b8,
where scrollbars got wider on Windows.
So if a contact has a long email or name, it would overflow
the chat list in "search" mode.

The new approach makes the widths less hard-coded
and lets the browser handle widths.
  • Loading branch information
WofWca committed Oct 24, 2024
1 parent c8db3cc commit d3dac2a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## Fixed
- image thumbnails not showing in chat list #4247
- progress bar not working #4248
- avoid showing horizontal scrollbars in chat list #4253

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

Expand Down
7 changes: 4 additions & 3 deletions packages/frontend/scss/chat/_chat-list-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@
}

& > .content {
// Ensure it's as wide as the parent allows, but doesn't overflow
// the parent if the content is too long.
width: 0;
flex-grow: 1;

margin-left: 10px;
// parent - 48px (for avatar) - 10px (our right padding)
max-width: calc(100% - 58px);

display: flex;
flex-direction: column;
Expand All @@ -46,7 +48,6 @@
flex-direction: row;
align-items: center;
& > .name {
width: 90%;
flex-grow: 1;
flex-shrink: 1;
font-size: 14px;
Expand Down
9 changes: 5 additions & 4 deletions packages/frontend/scss/contact/_contact.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
}

div.contact-name {
// Ensure it's as wide as the parent allows, but doesn't overflow
// the parent if the content is too long.
width: 0;
flex-grow: 1;

display: inline-block;
width: calc(100% - 64px);
// height: 54px;
margin-left: 10px;
.chat-list & {
width: calc(100% - 37px);
}
.display-name {
font-weight: bold;
margin-bottom: 0px;
Expand Down

0 comments on commit d3dac2a

Please sign in to comment.