From 001127c07f95173d7036db19d07dcfb1135f3caa Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 22 Jan 2024 21:45:28 -0500
Subject: fixed schema rows to render, fix for resizing docs from left side.
 all locking docs in non freeform view.  fix for labelBox with multiple rows
 to keep top rows.  cleaned up docViewPath/containerViewPath &

---
 src/client/views/collections/CollectionStackingView.tsx | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

(limited to 'src/client/views/collections/CollectionStackingView.tsx')

diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index 0a0218124..9384b7088 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -278,16 +278,15 @@ export class CollectionStackingView extends CollectionSubView<Partial<collection
     };
     @undoBatch
     onKeyDown = (e: React.KeyboardEvent, fieldProps: FieldViewProps) => {
-        const docView = fieldProps.DocumentView?.();
-        if (docView && ['Enter'].includes(e.key) && e.ctrlKey) {
+        if (['Enter'].includes(e.key) && e.ctrlKey) {
             e.stopPropagation?.();
             const below = !e.altKey && e.key !== 'Tab';
-            const layout_fieldKey = StrCast(docView.LayoutFieldKey);
-            const newDoc = Doc.MakeCopy(docView.Document, true);
-            const dataField = docView.Document[Doc.LayoutFieldKey(newDoc)];
+            const layout_fieldKey = StrCast(fieldProps.fieldKey);
+            const newDoc = Doc.MakeCopy(fieldProps.Document, true);
+            const dataField = fieldProps.Document[Doc.LayoutFieldKey(newDoc)];
             newDoc[DocData][Doc.LayoutFieldKey(newDoc)] = dataField === undefined || Cast(dataField, listSpec(Doc), null)?.length !== undefined ? new List<Doc>([]) : undefined;
-            if (layout_fieldKey !== 'layout' && docView.Document[layout_fieldKey] instanceof Doc) {
-                newDoc[layout_fieldKey] = docView.Document[layout_fieldKey];
+            if (layout_fieldKey !== 'layout' && fieldProps.Document[layout_fieldKey] instanceof Doc) {
+                newDoc[layout_fieldKey] = fieldProps.Document[layout_fieldKey];
             }
             Doc.GetProto(newDoc).text = undefined;
             FormattedTextBox.SetSelectOnLoad(newDoc);
@@ -327,7 +326,7 @@ export class CollectionStackingView extends CollectionSubView<Partial<collection
                 PanelHeight={panelHeight}
                 pointerEvents={this.DocumentView?.()._props.onClick?.() ? returnNone : undefined} // if the stack has an onClick, then we don't want the contents to be interactive (see CollectionPileView)
                 styleProvider={this.styleProvider}
-                containerViewPath={this.docViewPath}
+                containerViewPath={this.childContainerViewPath}
                 layout_fitWidth={this.childFitWidth}
                 isContentActive={doc.onClick ? this.isChildButtonContentActive : this.isChildContentActive}
                 onKey={this.onKeyDown}
-- 
cgit v1.2.3-70-g09d2

