You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-04 23:02:14 +03:00
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.
This commit is contained in:
@@ -27,6 +27,14 @@ import q from 'q';
|
|||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
displayName: 'MVideoBody',
|
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() {
|
getInitialState: function() {
|
||||||
return {
|
return {
|
||||||
decryptedUrl: null,
|
decryptedUrl: null,
|
||||||
@@ -100,6 +108,7 @@ module.exports = React.createClass({
|
|||||||
decryptedThumbnailUrl: thumbnailUrl,
|
decryptedThumbnailUrl: thumbnailUrl,
|
||||||
decryptedBlob: decryptedBlob,
|
decryptedBlob: decryptedBlob,
|
||||||
});
|
});
|
||||||
|
this.props.onWidgetLoad();
|
||||||
});
|
});
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.warn("Unable to decrypt attachment: ", err)
|
console.warn("Unable to decrypt attachment: ", err)
|
||||||
|
Reference in New Issue
Block a user