aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-03-06 19:46:43 -0500
committerbobzel <zzzman@gmail.com>2025-03-06 19:46:43 -0500
commit1ab6f6c87b746e0c2898694216db50d5faadf7f5 (patch)
tree84349c4bcbdfa0a53c4937421867e7665e7da663 /src/client/views/collections/CollectionMasonryViewFieldRow.tsx
parent5ad858090f3006631062877d90120e3cc505fada (diff)
a bunch of changes to improve how docs are selected automatically when created.
Diffstat (limited to 'src/client/views/collections/CollectionMasonryViewFieldRow.tsx')
-rw-r--r--src/client/views/collections/CollectionMasonryViewFieldRow.tsx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
index a0d5f9f70..996626575 100644
--- a/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
+++ b/src/client/views/collections/CollectionMasonryViewFieldRow.tsx
@@ -16,7 +16,7 @@ import { Transform } from '../../util/Transform';
import { undoBatch, undoable } from '../../util/UndoManager';
import { EditableView } from '../EditableView';
import { ObservableReactComponent } from '../ObservableReactComponent';
-import { FormattedTextBox } from '../nodes/formattedText/FormattedTextBox';
+import { DocumentView } from '../nodes/DocumentView';
import { CollectionStackingView } from './CollectionStackingView';
import './CollectionStackingView.scss';
@@ -162,9 +162,8 @@ export class CollectionMasonryViewFieldRow extends ObservableReactComponent<CMVF
if (!value && !forceEmptyNote) return false;
this._createEmbeddingSelected = false;
const { pivotField } = this._props;
- const newDoc = Docs.Create.TextDocument('', { _layout_autoHeight: true, _width: 200, _layout_fitWidth: true, title: value });
- Doc.SetSelectOnLoad(newDoc);
- FormattedTextBox.SelectOnLoadChar = value;
+ const newDoc = Docs.Create.TextDocument(value, { _layout_autoHeight: true, _width: 200, _layout_fitWidth: true, title: value });
+ DocumentView.SetSelectOnLoad(newDoc);
pivotField && (newDoc[DocData][pivotField] = this.getValue(this._props.heading));
const docs = this._props.parent.childDocList;
return docs ? !!docs.splice(0, 0, newDoc) : this._props.parent._props.addDocument?.(newDoc) || false; // should really extend addDocument to specify insertion point (at beginning of list)