Fixed a bug where the contextual menu was being incorrectly positioned when zoom in on the webpage

This commit is contained in:
wmwragg 2016-07-27 09:51:50 +01:00
parent 0eb15085e9
commit dca4702b7b
2 changed files with 7 additions and 4 deletions

View file

@ -77,8 +77,9 @@ module.exports = React.createClass({
onBadgeClicked: function(e) {
var Menu = sdk.getComponent('rooms.NotificationStateContextMenu');
var elementRect = e.target.getBoundingClientRect();
var x = elementRect.right;
var y = elementRect.top + (elementRect.height / 2);
// The window X and Y offsets are to adjust position when zoomed in to page
var x = elementRect.right + window.pageXOffset;
var y = elementRect.top + (elementRect.height / 2) + window.pageYOffset;
var self = this;
ContextualMenu.createMenu(Menu, {
left: x,