aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-06-04 12:41:48 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-06-04 12:41:48 -0500
commitb3b9d88efdc82650204afff4da3e28f2898c9c20 (patch)
treea0d5ed5e1df02ae7c5e6dd696f3435a6dfeaa30e /src
parent65ff6d515cd8102c3a4284244f8a84d356ba0c05 (diff)
fixed list overflow and deleting ()
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/ScriptingBox.scss4
-rw-r--r--src/client/views/nodes/ScriptingBox.tsx25
2 files changed, 22 insertions, 7 deletions
diff --git a/src/client/views/nodes/ScriptingBox.scss b/src/client/views/nodes/ScriptingBox.scss
index 32021e637..f28a2fcef 100644
--- a/src/client/views/nodes/ScriptingBox.scss
+++ b/src/client/views/nodes/ScriptingBox.scss
@@ -25,7 +25,6 @@
height: 100%;
table-layout: fixed;
- overflow-y: hidden;
white-space: nowrap;
.scriptingBox-wrapper {
@@ -35,7 +34,6 @@
display: flex;
flex-direction: row;
justify-content: center;
- overflow-y: hidden;
.scriptingBox-textArea {
flex: 70;
@@ -44,7 +42,6 @@
resize: none;
padding: 7px;
overflow-y: scroll;
- overflow-x: hidden;
body {
font-family: Arial, Helvetica, sans-serif;
@@ -58,6 +55,7 @@
margin-bottom: 60px !important;
overflow-y: scroll;
overflow-x: hidden;
+ overflow: hidden;
}
.rta__textarea {
diff --git a/src/client/views/nodes/ScriptingBox.tsx b/src/client/views/nodes/ScriptingBox.tsx
index 3c268b5cd..a3b11c734 100644
--- a/src/client/views/nodes/ScriptingBox.tsx
+++ b/src/client/views/nodes/ScriptingBox.tsx
@@ -48,6 +48,7 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
@observable private _suggestionBoxX: number = 0;
@observable private _suggestionBoxY: number = 0;
+ @observable private _lastChar: string = "";
@observable private _suggestionRef: any = React.createRef();
@observable private _scriptTextRef: any = React.createRef();
@@ -519,15 +520,31 @@ export class ScriptingBox extends ViewBoxAnnotatableComponent<FieldViewProps, Sc
} else {
console.log(this.rawScript.split("(").length - 1);
console.log(this.rawScript.split(")").length - 1);
- if (this.rawScript.split("(").length - 1 <= this.rawScript.split(")").length - 1) {
- console.log("removed params");
- this._paramSuggestion = false;
+ if (e.key === "Backspace") {
+ if (this._lastChar === "(") {
+ console.log("removed params");
+ this._paramSuggestion = false;
+ } else if (this._lastChar === ")") {
+ if (this.rawScript.slice(0, this.rawScript.length - 1).split("(").length - 1 > this.rawScript.slice(0, this.rawScript.length - 1).split(")").length - 1) {
+ if (this._scriptSuggestedParams.length > 0) {
+ console.log("suggestion params");
+ this._paramSuggestion = true;
+ }
+ }
+ }
} else {
- if (e.key === "Backspace") {
+ if (this.rawScript.split("(").length - 1 <= this.rawScript.split(")").length - 1) {
console.log("removed params");
this._paramSuggestion = false;
}
}
+
+ }
+ if (e.key === "Backspace") {
+ this._lastChar = this.rawScript[this.rawScript.length - 2];
+ console.log("last char: " + this._lastChar);
+ } else {
+ this._lastChar = e.key;
}
}