From 2c51a5c199a47b37d022d3bc3211420d6a76be12 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 20 Nov 2015 16:01:51 +0000 Subject: [PATCH] Bugfix: don't cache the read avatar rect as it's relative to the viewport and it will move when we scroll! --- src/skins/vector/views/molecules/EventTile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/skins/vector/views/molecules/EventTile.js b/src/skins/vector/views/molecules/EventTile.js index 02e5d167..20d7f1ec 100644 --- a/src/skins/vector/views/molecules/EventTile.js +++ b/src/skins/vector/views/molecules/EventTile.js @@ -71,7 +71,7 @@ module.exports = React.createClass({ }, componentDidUpdate: function() { - this.readAvatarRect = ReactDom.findDOMNode(this.readAvatarNode).getBoundingClientRect(); + this.readAvatarNode = ReactDom.findDOMNode(this.readAvatarNode); }, onEditClicked: function(e) { @@ -136,8 +136,8 @@ module.exports = React.createClass({ oldNodeTop = oldAvatarDomNode.getBoundingClientRect().top; } - if (this.readAvatarRect) { - var topOffset = oldNodeTop - this.readAvatarRect.top; + if (this.readAvatarNode) { + var topOffset = oldNodeTop - this.readAvatarNode.getBoundingClientRect().top; if (oldAvatarDomNode && oldAvatarDomNode.style.left !== '0px') { var leftOffset = oldAvatarDomNode.style.left;