Skip to content

Commit 90fc922

Browse files
committed
Fix handling of 1px tall messages
Explanation: https://stackoverflow.com/a/38523642/1009797
1 parent 77af296 commit 90fc922

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/components/MessageList/VirtualizedMessageList.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,7 @@ const VirtualizedMessageList = ({
118118
*/
119119
const Item = (props) => {
120120
return (
121-
<div
122-
{...props}
123-
style={{
124-
display: 'inline-block',
125-
width: '100%',
126-
}}
127-
/>
121+
<div {...props} className="str-chat__virtual-list-message-wrapper" />
128122
);
129123
};
130124

src/styles/VirtualMessage.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
}
2525

2626
.str-chat__virtual-list {
27+
// this resolves the issue with 1px tall messages (i.e. deleted messages)
28+
font-size: 0;
2729
.str-chat__message.str-chat__message--deleted {
2830
align-items: initial;
2931
padding: 16px 42px;
@@ -35,6 +37,11 @@
3537
}
3638
}
3739

40+
.str-chat__virtual-list-message-wrapper {
41+
display: inline-block;
42+
width: 100%;
43+
}
44+
3845
.str-chat__virtual-message__meta {
3946
display: flex;
4047
flex-direction: row;

0 commit comments

Comments
 (0)