mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Merge pull request #189 from matrix-org/rav/fix_timeline_react_keys
Flatten arrays of components before adding to messagepanel li
This commit is contained in:
commit
7820a5d900
1 changed files with 4 additions and 1 deletions
|
@ -198,7 +198,10 @@ module.exports = React.createClass({
|
|||
var last = (i == lastShownEventIndex);
|
||||
|
||||
if (wantTile) {
|
||||
ret.push(this._getTilesForEvent(prevEvent, mxEv, last));
|
||||
// make sure we unpack the array returned by _getTilesForEvent,
|
||||
// otherwise react will auto-generate keys and we will end up
|
||||
// replacing all of the DOM elements every time we paginate.
|
||||
ret.push(...this._getTilesForEvent(prevEvent, mxEv, last));
|
||||
prevEvent = mxEv;
|
||||
} else if (!mxEv.status) {
|
||||
// if we aren't showing the event, put in a dummy scroll token anyway, so
|
||||
|
|
Loading…
Reference in a new issue