diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js b/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js index 3d05fd1c8..703b57309 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/typeSearch.js @@ -279,6 +279,11 @@ RED.typeSearch = (function() { if ($("#red-ui-main-container").height() - opts.y - 195 < 0) { opts.y = opts.y - 275; } + const dialogWidth = dialog.width() || 300 // default is 300 (defined in class .red-ui-search) + const workspaceWidth = $('#red-ui-workspace').width() + if (workspaceWidth > dialogWidth && workspaceWidth - opts.x - dialogWidth < 0) { + opts.x = opts.x - (dialogWidth - RED.view.node_width) + } dialog.css({left:opts.x+"px",top:opts.y+"px"}).show(); searchResultsDiv.slideDown(300); setTimeout(function() {