File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/components/MessagesList Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -919,7 +919,7 @@ export default {
919919
920920 // When the current message is not visible (reaction or expired)
921921 // we use the next message from the list start the scroller-visibility check
922- if (! el) {
922+ if (! el || el . offsetParent === null ) {
923923 const messageId = this .$store .getters .getFirstDisplayableMessageIdAfterReadMarker (this .token , this .conversation .lastReadMessage )
924924 el = document .getElementById (' message_' + messageId)
925925 }
@@ -967,6 +967,18 @@ export default {
967967 let el = document .getElementById (' message_' + this .visualLastReadMessageId )
968968 if (el) {
969969 el = el .closest (' .message' )
970+ if (el === null || el .offsetParent === null ) {
971+ // Exception: when the message remains not visible
972+ // e.g: it is the last message in collapsed group
973+ // unread marker is set to the combined system message.
974+ // Look for the unread marker itself
975+ el = document .querySelector (' .new-message-marker' )
976+ if (el) {
977+ el = el .closest (' .message' )
978+ } else {
979+ console .warn (' Visual last read message element not found' )
980+ }
981+ }
970982 }
971983
972984 return el
You can’t perform that action at this time.
0 commit comments