Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3246432
D8259.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8259.diff
View Options
diff --git a/web/components/message-result.css b/web/components/message-result.css
--- a/web/components/message-result.css
+++ b/web/components/message-result.css
@@ -1,11 +1,14 @@
.messageContainer {
- overflow-y: scroll;
border: 1px solid var(--pin-message-modal-border-color);
border-radius: 7px;
- max-height: 400px;
margin: 0 32px 16px 32px;
}
+.messageContainerOverflow {
+ overflow-y: scroll;
+ max-height: 400px;
+}
+
.messageDate {
color: var(--chat-timestamp-color);
font-size: var(--xs-font-12);
diff --git a/web/components/message-result.react.js b/web/components/message-result.react.js
--- a/web/components/message-result.react.js
+++ b/web/components/message-result.react.js
@@ -1,5 +1,6 @@
// @flow
+import classNames from 'classnames';
import * as React from 'react';
import { useStringForUser } from 'lib/hooks/ens-cache.js';
@@ -15,10 +16,11 @@
type MessageResultProps = {
+item: ChatMessageInfoItem,
+threadInfo: ThreadInfo,
+ +scrollable: boolean,
};
function MessageResult(props: MessageResultProps): React.Node {
- const { item, threadInfo } = props;
+ const { item, threadInfo, scrollable } = props;
const getTextMessageMarkdownRules = useTextMessageRulesFunc(threadInfo);
const messageListContext = React.useMemo(() => {
@@ -33,8 +35,13 @@
shouldShowUsername ? item.messageInfo.creator : null,
);
+ const messageContainerClassNames = classNames({
+ [css.messageContainer]: true,
+ [css.messageContainerOverflow]: scrollable,
+ });
+
return (
- <div className={css.messageContainer}>
+ <div className={messageContainerClassNames}>
<div>
<div className={css.creator}>{username}</div>
<div className={css.messageContent}>
diff --git a/web/modals/chat/message-results-modal.react.js b/web/modals/chat/message-results-modal.react.js
--- a/web/modals/chat/message-results-modal.react.js
+++ b/web/modals/chat/message-results-modal.react.js
@@ -122,6 +122,7 @@
key={item.messageInfo.id}
item={item}
threadInfo={threadInfo}
+ scrollable={false}
/>
));
return <>{items}</>;
diff --git a/web/modals/chat/toggle-pin-modal.react.js b/web/modals/chat/toggle-pin-modal.react.js
--- a/web/modals/chat/toggle-pin-modal.react.js
+++ b/web/modals/chat/toggle-pin-modal.react.js
@@ -102,7 +102,11 @@
return (
<Modal name={modalInfo.name} onClose={popModal} size="large">
<div className={css.confirmationText}>{modalInfo.confirmationText}</div>
- <MessageResult item={modifiedItem} threadInfo={threadInfo} />
+ <MessageResult
+ item={modifiedItem}
+ threadInfo={threadInfo}
+ scrollable={true}
+ />
<div className={css.buttonContainer}>
<Button
variant="filled"
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 15, 11:43 PM (20 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2495798
Default Alt Text
D8259.diff (2 KB)
Attached To
Mode
D8259: [web] Prevent nested scroll in the message results modal
Attached
Detach File
Event Timeline
Log In to Comment