mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Bugfix: don't cache the read avatar rect as it's relative to the viewport and it will move when we scroll!
This commit is contained in:
parent
6dc5dd4930
commit
2c51a5c199
@ -71,7 +71,7 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
componentDidUpdate: function() {
|
componentDidUpdate: function() {
|
||||||
this.readAvatarRect = ReactDom.findDOMNode(this.readAvatarNode).getBoundingClientRect();
|
this.readAvatarNode = ReactDom.findDOMNode(this.readAvatarNode);
|
||||||
},
|
},
|
||||||
|
|
||||||
onEditClicked: function(e) {
|
onEditClicked: function(e) {
|
||||||
@ -136,8 +136,8 @@ module.exports = React.createClass({
|
|||||||
oldNodeTop = oldAvatarDomNode.getBoundingClientRect().top;
|
oldNodeTop = oldAvatarDomNode.getBoundingClientRect().top;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.readAvatarRect) {
|
if (this.readAvatarNode) {
|
||||||
var topOffset = oldNodeTop - this.readAvatarRect.top;
|
var topOffset = oldNodeTop - this.readAvatarNode.getBoundingClientRect().top;
|
||||||
|
|
||||||
if (oldAvatarDomNode && oldAvatarDomNode.style.left !== '0px') {
|
if (oldAvatarDomNode && oldAvatarDomNode.style.left !== '0px') {
|
||||||
var leftOffset = oldAvatarDomNode.style.left;
|
var leftOffset = oldAvatarDomNode.style.left;
|
||||||
|
Loading…
Reference in New Issue
Block a user