From d245b5101253814219fd68368c62cf78b9d24ef7 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Thu, 4 Jun 2020 16:00:18 -0500 Subject: fixed on enter, trying resize --- src/client/views/nodes/ScriptingBox.tsx | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx index a3b11c734..a621e2bc6 100644 --- a/src/client/views/nodes/ScriptingBox.tsx +++ b/src/client/views/nodes/ScriptingBox.tsx @@ -18,6 +18,7 @@ import { FieldView, FieldViewProps } from "../nodes/FieldView"; import { OverlayView } from "../OverlayView"; import { DocumentIconContainer } from "./DocumentIcon"; import "./ScriptingBox.scss"; +const _global = (window /* browser */ || global /* node */) as any; import ReactTextareaAutocomplete from "@webscopeio/react-textarea-autocomplete"; import "@webscopeio/react-textarea-autocomplete/style.css"; @@ -53,6 +54,9 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent p.split(":")[0].trim()); } @computed({ keepAlive: true }) get paramsTypes() { return this.compileParams.map(p => p.split(":")[1].trim()); } @@ -107,9 +111,25 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent { + for (const entry of entries) { + this._panelWidth = entry.contentRect.width; + this._panelHeight = entry.contentRect.height; + this.onActiveContentItemChanged(); + } + })); + observer.observe(document.getElementsByClassName("scriptingBox")[0]); } - componentWillUnmount() { this._overlayDisposer?.(); } + componentWillUnmount() { + this._overlayDisposer?.(); + } + + @action.bound + private onActiveContentItemChanged() { + this.suggestionPos(); + } protected createDashEventsTarget = (ele: HTMLDivElement, dropFunc: (e: Event, de: DragManager.DropEvent) => void) => { //used for stacking and masonry view if (ele) { @@ -475,6 +495,9 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent