From fc1fd8902b090b75c81347a37cce15145322b4e2 Mon Sep 17 00:00:00 2001 From: Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> Date: Sat, 22 Jun 2024 23:55:38 -0400 Subject: moving row no longer messes up cell field (of course it was batching...) --- src/client/views/EditableView.tsx | 2 +- .../views/collections/collectionSchema/SchemaCellField.tsx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx index 78977bcb8..8e48b4c11 100644 --- a/src/client/views/EditableView.tsx +++ b/src/client/views/EditableView.tsx @@ -193,7 +193,7 @@ export class EditableView extends ObservableReactComponent { @action onClick = (e?: React.MouseEvent) => { this._props.onClick && this._props.onClick(); - if (this._props.editing !== false) { + if (this._props.editing) { e?.nativeEvent.stopPropagation(); if (this._ref.current && this._props.showMenuOnLoad) { this._props.menuCallback?.(this._ref.current.getBoundingClientRect().x, this._ref.current.getBoundingClientRect().y); diff --git a/src/client/views/collections/collectionSchema/SchemaCellField.tsx b/src/client/views/collections/collectionSchema/SchemaCellField.tsx index e2aa27a95..ffda334ec 100644 --- a/src/client/views/collections/collectionSchema/SchemaCellField.tsx +++ b/src/client/views/collections/collectionSchema/SchemaCellField.tsx @@ -34,15 +34,17 @@ export class SchemaCellField extends ObservableReactComponent { + this._unrenderedContent = this._props.GetValue() ?? ''; + this.setContent(this._unrenderedContent, true); + }, 0); //must be moved to end of batch or else other docs aren't loaded, so render as d-1 in function } get docIndex(){return DocumentView.getDocViewIndex(this._props.Document);} // prettier-ignore componentDidMount(): void { - setTimeout(() => { - this._unrenderedContent = this._props.GetValue() ?? ''; - this.setContent(this._unrenderedContent, true); - }, 0); //must be moved to end of batch or else other docs aren't loaded, so render as d-1 in function + this._unrenderedContent = this._props.GetValue() ?? ''; + this.setContent(this._unrenderedContent, true); this._disposers.editing = reaction( () => this._editing, editing => { -- cgit v1.2.3-70-g09d2