aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/collectionSchema/SchemaCellField.tsx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/views/collections/collectionSchema/SchemaCellField.tsx b/src/client/views/collections/collectionSchema/SchemaCellField.tsx
index 72d89adc3..7bdfaa587 100644
--- a/src/client/views/collections/collectionSchema/SchemaCellField.tsx
+++ b/src/client/views/collections/collectionSchema/SchemaCellField.tsx
@@ -219,6 +219,7 @@ export class SchemaCellField extends ObservableReactComponent<SchemaCellFieldPro
};
onChange = (e: FormEvent<HTMLDivElement> | undefined, newText?: string) => {
+ console.log('onchange called')
const prevVal = this._unrenderedContent;
const targVal = newText ?? e!.currentTarget.innerText; // TODO: bang
if (!(targVal.startsWith(':=') || targVal.startsWith('='))) {
@@ -230,6 +231,7 @@ export class SchemaCellField extends ObservableReactComponent<SchemaCellFieldPro
this._unrenderedContent = targVal;
this._props.highlightCells?.(targVal);
if (this.shouldUpdate(prevVal, targVal)) {this.setContent(targVal, true)};
+ console.log('cursorpos: ' + this.cursorPosition + ' char: ' + this.lastCharBeforeCursor);
this.setupRefSelect(this.refSelectConditionMet);
};
@@ -262,6 +264,7 @@ export class SchemaCellField extends ObservableReactComponent<SchemaCellFieldPro
break;
case 'ArrowUp': case 'ArrowDown': case 'ArrowLeft': case 'ArrowRight': // prettier-ignore
e.stopPropagation();
+ setTimeout(() => this.setupRefSelect(this.refSelectConditionMet), 0)
break;
case ' ':
e.stopPropagation();
@@ -330,7 +333,7 @@ export class SchemaCellField extends ObservableReactComponent<SchemaCellFieldPro
autoFocus
onInput={this.onChange}
onKeyDown={this.onKeyDown}
- onPointerDown={e => e.stopPropagation}
+ onPointerDown={e => {e.stopPropagation(); setTimeout(() => this.setupRefSelect(this.refSelectConditionMet), 0)}} //timeout callback ensures that refSelectMode is properly set
onClick={e => e.stopPropagation}
onPointerUp={e => e.stopPropagation}
onPointerMove={e => {e.stopPropagation(); e.preventDefault()}}