Skip to content

Commit

Permalink
Fix add reaction (#25222)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriellsh committed Apr 19, 2022
1 parent f6cac21 commit cf0b627
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/meteor/app/emoji/client/lib/EmojiPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions apps/meteor/app/ui-utils/client/lib/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down

0 comments on commit cf0b627

Please sign in to comment.