diff --git a/src/definitions/modules/popup.js b/src/definitions/modules/popup.js index 28892a7615..2fe17ceb7c 100644 --- a/src/definitions/modules/popup.js +++ b/src/definitions/modules/popup.js @@ -818,7 +818,12 @@ if (searchDepth === settings.maxSearchDepth && typeof settings.lastResort === 'string') { position = settings.lastResort; } - + if (position === 'top right' || position === 'bottom right') { + var possibleMargin = calculations.boundary.right - calculations.parent.width; + if (possibleMargin > 0) { + offset -= possibleMargin; + } + } switch (position) { case 'top left': { positioning = {