diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js b/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js index a8b787ba5..44090aa1a 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/contextMenu.js @@ -152,8 +152,16 @@ RED.contextMenu = (function() { } } + + var direction = "right"; + var MENU_WIDTH = 600; // can not use menu width here + if ((options.x -$(document).scrollLeft()) > + ($(window).height() -MENU_WIDTH)) { + direction = "left"; + } + menu = RED.menu.init({ - direction: 'right', + direction: direction, onpreselect: function() { disposeMenu() },