Fix Message Detail Reaction Viewer overflow (#6239)

This commit is contained in:
ayumi-signal 2023-09-12 12:52:16 -07:00 committed by GitHub
parent d2f1431a66
commit 7ea945c157
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View file

@ -149,7 +149,7 @@ export function MessageDetail({
toggleSafetyNumberModal, toggleSafetyNumberModal,
viewStory, viewStory,
}: Props): JSX.Element { }: Props): JSX.Element {
const messageContainerRef = useRef<HTMLDivElement>(null); const messageDetailRef = useRef<HTMLDivElement>(null);
function renderAvatar(contact: Contact): JSX.Element { function renderAvatar(contact: Contact): JSX.Element {
const { const {
@ -315,19 +315,16 @@ export function MessageDetail({
: undefined; : undefined;
return ( return (
<div className="module-message-detail"> <div className="module-message-detail" ref={messageDetailRef}>
<PanelSection> <PanelSection>
<div <div className="module-message-detail__message-container">
className="module-message-detail__message-container"
ref={messageContainerRef}
>
<Message <Message
{...message} {...message}
renderingContext="conversation/MessageDetail" renderingContext="conversation/MessageDetail"
checkForAccount={checkForAccount} checkForAccount={checkForAccount}
clearTargetedMessage={clearTargetedMessage} clearTargetedMessage={clearTargetedMessage}
contactNameColor={contactNameColor} contactNameColor={contactNameColor}
containerElementRef={messageContainerRef} containerElementRef={messageDetailRef}
containerWidthBreakpoint={WidthBreakpoint.Wide} containerWidthBreakpoint={WidthBreakpoint.Wide}
renderMenu={undefined} renderMenu={undefined}
disableScroll disableScroll

View file

@ -2668,9 +2668,10 @@
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/conversation/MessageDetail.tsx", "path": "ts/components/conversation/MessageDetail.tsx",
"line": " const messageContainerRef = useRef<HTMLDivElement>(null);", "line": " const messageDetailRef = useRef<HTMLDivElement>(null);",
"reasonCategory": "usageTrusted", "reasonCategory": "usageTrusted",
"updated": "2023-04-12T15:51:28.066Z" "updated": "2023-09-11T22:53:43.464Z",
"reasonDetail": "Used to pass ref of MessageDetail to Message. Used for ReactionViewer overflow detection."
}, },
{ {
"rule": "React-useRef", "rule": "React-useRef",