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 vector-im/riot-web#10975
pull/21833/head
J. Ryan Stinnett 2020-06-30 18:40:52 +01:00
parent bb9ae7b55b
commit 51118863c7
1 changed files with 5 additions and 2 deletions

View File

@ -388,8 +388,11 @@ export default class MessagePanel extends React.Component {
} }
return ( return (
<li key={"readMarker_"+eventId} ref={this._readMarkerNode} <li key={"readMarker_"+eventId}
className="mx_RoomView_myReadMarker_container"> ref={this._readMarkerNode}
className="mx_RoomView_myReadMarker_container"
data-scroll-tokens={eventId}
>
{ hr } { hr }
</li> </li>
); );