Fix scroll jumping when a video is decrypted

Call the `onWidgetLoad` prop on MVideoBody to notify the scroll panel to keep it's position when the size of the video widget updates.
pull/21833/head
Luke Barnard 2016-12-20 12:33:07 +00:00
parent d0d056e308
commit 2658cd09b5
1 changed files with 9 additions and 0 deletions

View File

@ -27,6 +27,14 @@ import q from 'q';
module.exports = React.createClass({
displayName: 'MVideoBody',
propTypes: {
/* the MatrixEvent to show */
mxEvent: React.PropTypes.object.isRequired,
/* called when the video has loaded */
onWidgetLoad: React.PropTypes.func.isRequired,
},
getInitialState: function() {
return {
decryptedUrl: null,
@ -100,6 +108,7 @@ module.exports = React.createClass({
decryptedThumbnailUrl: thumbnailUrl,
decryptedBlob: decryptedBlob,
});
this.props.onWidgetLoad();
});
}).catch((err) => {
console.warn("Unable to decrypt attachment: ", err)