From 096657681737fbd30ed550c3d35a91bf60648afc Mon Sep 17 00:00:00 2001 From: gabriellsh Date: Mon, 18 Apr 2022 22:03:02 -0300 Subject: [PATCH] Fix add reaction --- apps/meteor/app/emoji/client/lib/EmojiPicker.js | 8 ++++++-- apps/meteor/app/ui-utils/client/lib/popover.js | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/meteor/app/emoji/client/lib/EmojiPicker.js b/apps/meteor/app/emoji/client/lib/EmojiPicker.js index fd3225dce4ef..8c5f883dfacf 100644 --- a/apps/meteor/app/emoji/client/lib/EmojiPicker.js +++ b/apps/meteor/app/emoji/client/lib/EmojiPicker.js @@ -70,8 +70,12 @@ export const EmojiPicker = { const windowHeight = window.innerHeight; const windowWidth = window.innerWidth; const windowBorder = 10; - const sourcePos = $(this.source).offset(); - const { left, top } = sourcePos; + + // get the position of the source element + let { left, top } = this.source.getBoundingClientRect(); + left += window.scrollX; + top += window.scrollY; + const cssProperties = { top, left }; const isLargerThanWindow = this.width + windowBorder > windowWidth; diff --git a/apps/meteor/app/ui-utils/client/lib/popover.js b/apps/meteor/app/ui-utils/client/lib/popover.js index 0eafb9c42084..7a387095dcc5 100644 --- a/apps/meteor/app/ui-utils/client/lib/popover.js +++ b/apps/meteor/app/ui-utils/client/lib/popover.js @@ -157,6 +157,7 @@ Template.popover.onDestroyed(function () { Template.popover.events({ 'click .js-action'(e, instance) { + e.stopPropagation(); !this.action || this.action.call(this, e, instance.data.data); popover.close(); },