Skip to content

Commit 4ba940c

Browse files
OliverGeneserzzacharo
authored andcommitted
fix: timeline event body forward ref
1 parent 3eabdd7 commit 4ba940c

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

invenio_requests/assets/semantic-ui/js/invenio_requests/components/TimelineActionEvent.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class TimelineActionEvent extends Component {
5454
<b>{user}</b>
5555
<Feed.Date>
5656
<TimelineEventBody
57+
collapsible={false}
5758
payload={{ ...event.payload, content: eventContent }}
5859
/>{" "}
5960
{toRelativeTime(event.created, i18next.language)}

invenio_requests/assets/semantic-ui/js/invenio_requests/components/TimelineEventBody.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@ TimelineEventBody.defaultProps = {
4141
expandedByDefault: false,
4242
};
4343

44-
const TimelineEventBodyRender = ({
45-
ref,
44+
const TimelineEventBodyRender = React.forwardRef(({
4645
refInner,
4746
isOverflowing,
4847
expanded,
4948
collapsible,
5049
toggleCollapsed,
5150
content,
5251
format,
53-
}) => {
52+
files,
53+
}, ref) => {
5454
const getCollapsibleClass = () => {
5555
if (!isOverflowing) return "";
5656
return expanded || !collapsible ? "expanded" : "overflowing";
5757
};
5858

5959
return (
60-
<span ref={ref} className={`collapsible-comment ${getCollapsibleClass()}`}>
60+
<span ref={ref} className={`${collapsible ? "collapsible-comment" : ""} ${getCollapsibleClass()}`}>
6161
<span ref={refInner} className={collapsible ? "collapsible-comment-inner" : ""}>
6262
{format === "html" ? (
6363
<span dangerouslySetInnerHTML={{ __html: content }} />
@@ -76,10 +76,9 @@ const TimelineEventBodyRender = ({
7676
</span>
7777
</span>
7878
);
79-
};
79+
});
8080

8181
TimelineEventBodyRender.propTypes = {
82-
ref: PropTypes.instanceOf(Element).isRequired,
8382
refInner: PropTypes.instanceOf(Element).isRequired,
8483
isOverflowing: PropTypes.bool.isRequired,
8584
expanded: PropTypes.bool.isRequired,

0 commit comments

Comments
 (0)