Merge pull request #715 from matrix-org/luke/mels-scrolling-fix

MELS: check scroll on load + use mels-1,-2,... key
This commit is contained in:
David Baker 2017-02-23 10:12:26 +00:00 committed by GitHub
commit 8737112a8c
2 changed files with 6 additions and 1 deletions

View file

@ -349,7 +349,9 @@ module.exports = React.createClass({
<MemberEventListSummary
key={key}
events={summarisedEvents}
data-scroll-token={eventId}>
data-scroll-token={eventId}
onToggle={this._onWidgetLoad} // Update scroll state
>
{eventTiles}
</MemberEventListSummary>
);

View file

@ -30,6 +30,8 @@ module.exports = React.createClass({
avatarsMaxLength: React.PropTypes.number,
// The minimum number of events needed to trigger summarisation
threshold: React.PropTypes.number,
// Called when the MELS expansion is toggled
onToggle: React.PropTypes.func,
},
getInitialState: function() {
@ -63,6 +65,7 @@ module.exports = React.createClass({
this.setState({
expanded: !this.state.expanded,
});
this.props.onToggle();
},
/**