From 21fb764a5d53b3f3f9753293a28234712f4978a8 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Thu, 4 Jun 2020 21:13:12 -0500 Subject: fixed wrapping params on resize --- src/client/views/nodes/ScriptingBox.tsx | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx index a621e2bc6..00bbafeb7 100644 --- a/src/client/views/nodes/ScriptingBox.tsx +++ b/src/client/views/nodes/ScriptingBox.tsx @@ -57,6 +57,9 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent p.split(":")[0].trim()); } @computed({ keepAlive: true }) get paramsTypes() { return this.compileParams.map(p => p.split(":")[1].trim()); } @@ -116,7 +119,25 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent (x + scriptWidth)) { + const diff = (left + suggestionWidth) - (x + scriptWidth); + left = left - diff; + } + + runInAction(() => { + this._suggestionBoxX = left; + this._suggestionBoxY = top; + }); } })); observer.observe(document.getElementsByClassName("scriptingBox")[0]); @@ -126,11 +147,6 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent void) => { //used for stacking and masonry view if (ele) { this.dropDisposer?.(); @@ -500,8 +516,11 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent