Skip to content

Commit 5111886

Browse files
committed
Fix jumping to read marker for events without tiles
It is possible for your read marker to be set to an event without a tile (like a reaction). We would still render the read marker at the position of those events in the timeline, even though there's no matching tile, which breaks a core assumption of jump to read marker path: it assumes that if the read marker node is present in the DOM, then there must also be an event tile with a scroll token matching the event ID. This fixes the situation by setting a scroll token on the read marker so it can always be scrolled to, no matter what kind of event it might represent. Fixes element-hq/element-web#10975
1 parent bb9ae7b commit 5111886

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/structures/MessagePanel.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,11 @@ export default class MessagePanel extends React.Component {
388388
}
389389

390390
return (
391-
<li key={"readMarker_"+eventId} ref={this._readMarkerNode}
392-
className="mx_RoomView_myReadMarker_container">
391+
<li key={"readMarker_"+eventId}
392+
ref={this._readMarkerNode}
393+
className="mx_RoomView_myReadMarker_container"
394+
data-scroll-tokens={eventId}
395+
>
393396
{ hr }
394397
</li>
395398
);

0 commit comments

Comments
 (0)