Changed position for data scroll token#6150
Conversation
Signed-off-by: Ayush PS <ayushpratap16@gmail.com>
germain-gg
left a comment
There was a problem hiding this comment.
Thank you for working on this task!
The removal of the list item surrounding the EventTile was intentional and is probably something that we'd like to keep. Having two elements does not serve any purpose in this case and inflates the DOM size which can lead to a slow down in runtime performances
What I didn't notice unfortunately is that there is a couple of return statement in EventTile.tsx meaning that the root element of that component does not always have the same props
I'd recommend you to update the following to change the tag to a li and add a data-scroll-tokens attribute
|
Hmm, doesn't having random child divs in the I guess @gsouquet recommendation also resolves it though, as long as all children are considered, e.g also things like |
|
Yes, I do believe those |
And the pass-thru mode of EventListSummary presumably? |
|
Thank you again for your contribution @DantrazTrev Unfortunately due to timing constraint due to the severity of the issue I had to write a fix as part of #6154 that pretty much follows the requested changes that me and Michael provided in this PR |
No issues I was stuck in a bit of an academic program. I'll work on this element-hq/element-web/issues/17561 which also regressed in the same PR |
Moved the data-scroll-token back to li
Fixes element-hq/element-web/issues/17567
From how much I could understand the changes that occurred in #6079
Specifically changing the
EventTileto be rendered asliand changing thedata-scroll-tokento be in the listmatrix-react-sdk/src/components/structures/MessagePanel.js
Lines 653 to 654 in abfe6d8
In short
data-scroll-tokens were missing and caused the scrollstate to be back at the beginning as no scroll state is saved resets to start after every state changeDetailed Explanation (That might help find an alternative rather than just reverting it back )
This specifically caused a few issues namely the
EventTilelist due to being rendered asliis now a series of divs that don't make use of much of thedata-scroll-token(Screen shot below)This is really different from the list with
data-scroll-tokenfrom the<li>approach where theEventTileis wrapped around anlielement withdata-scroll-tokenThe token is important as it is used in the
ScrollPanel'sgetScrollStateto mark the scroll state of the list.This caused the bug so every state update for
FilePanelor its children caused it to reset to the end of the list. This explains the part in element-hq/element-web/issues/17567 whereonFillRequestcausesbackpaginatingstate to change.An alternative could be adding the token to the
EventTilebut for now this might suffice.PS: The failing tests are the ones that had been adjusted previously for the later approach, can be updated if we get approval for this change, otherwise the current approach could be changed to fit with them
Signed-off-by: Ayush Pratap Singh ayushpratap16@gmail.com