diff options
-rw-r--r-- | src/client/views/collections/CollectionSchemaCells.tsx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx index 42c5375ce..e9c5c009f 100644 --- a/src/client/views/collections/CollectionSchemaCells.tsx +++ b/src/client/views/collections/CollectionSchemaCells.tsx @@ -249,11 +249,10 @@ export class CollectionSchemaCell extends React.Component<CellProps> { if (isNaN(parseInt(s))) { inputIsNum = false; } - console.log(inputIsNum); } // check if the input is a boolean let inputIsBool: boolean = value == "false" || value == "true"; - + // what to do in the case if (!inputIsNum && !inputIsBool && !value.startsWith("=")) { // if it's not a number, it's a string, and should be processed as such // strips the string of quotes when it is edited to prevent quotes form being added to the text automatically @@ -278,7 +277,7 @@ export class CollectionSchemaCell extends React.Component<CellProps> { inputAsString += '"'; //two options here: we can strip off outer quotes or we can figure out what's going on with the script const script = CompileScript(inputAsString, { requiredType: type, typecheck: false, editable: true, addReturn: true, params: { this: Doc.name, $r: "number", $c: "number", $: "any" } }); - script.compiled && (retVal = this.applyToDoc(inputAsString.length !== value.length ? this._rowDoc : this._rowDataDoc, this.props.row, this.props.col, script.run)); + script.compiled && (retVal = this.applyToDoc((inputAsString.length !== value.length || inputAsString.length - 2 !== value.length) ? this._rowDoc : this._rowDataDoc, this.props.row, this.props.col, script.run)); // handle numbers and expressions } else if (inputIsNum || value.startsWith("=")) { //TODO: make accept numbers |