diff --git a/js/builder.es6.js b/js/builder.es6.js
index 3ce00d8aba386753fb5a986842f5b1edb3f82d18..cf0b734fefa18b8e36ea938009b8a52174562db8 100644
--- a/js/builder.es6.js
+++ b/js/builder.es6.js
@@ -47,6 +47,16 @@
         const height = viewPortHeight - 200;
         $dialog.dialog('option', 'height', height);
         $dialog.css('overscroll-behavior', 'contain');
+
+        if ($dialog.data('lpOriginalHeight') !== height) {
+          $dialog.data('lpOriginalHeight', height);
+          const bounding = dialog.getBoundingClientRect();
+          const viewPortHeight = window.innerHeight || document.documentElement.clientHeight;
+          if (bounding.bottom > viewPortHeight) {
+            const pos = $dialog.dialog('option', 'position');
+            $dialog.dialog('option', 'position', pos);
+          }
+        }
       }
     });
   }
diff --git a/js/builder.js b/js/builder.js
index 8a4cb798c29c53b57fc4dbd2a04344ca1670cca6..d1d8446ed7d5f710474925b0f043f793e7662991 100644
--- a/js/builder.js
+++ b/js/builder.js
@@ -33,6 +33,15 @@
         var height = viewPortHeight - 200;
         $dialog.dialog('option', 'height', height);
         $dialog.css('overscroll-behavior', 'contain');
+        if ($dialog.data('lpOriginalHeight') !== height) {
+          $dialog.data('lpOriginalHeight', height);
+          var _bounding = dialog.getBoundingClientRect();
+          var _viewPortHeight = window.innerHeight || document.documentElement.clientHeight;
+          if (_bounding.bottom > _viewPortHeight) {
+            var pos = $dialog.dialog('option', 'position');
+            $dialog.dialog('option', 'position', pos);
+          }
+        }
       }
     });
   }