Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix jumping to read marker for events without tiles
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jryans committed Jun 30, 2020
1 parent bb9ae7b commit 5111886
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/structures/MessagePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,11 @@ export default class MessagePanel extends React.Component {
}

return (
<li key={"readMarker_"+eventId} ref={this._readMarkerNode}
className="mx_RoomView_myReadMarker_container">
<li key={"readMarker_"+eventId}
ref={this._readMarkerNode}
className="mx_RoomView_myReadMarker_container"
data-scroll-tokens={eventId}
>
{ hr }
</li>
);
Expand Down

0 comments on commit 5111886

Please sign in to comment.