From a763c4e80cec6aef5219a8c9fcfa2ddccbc10b0a Mon Sep 17 00:00:00 2001 From: eleanor-park Date: Wed, 24 Jul 2024 16:52:50 -0400 Subject: bug and render fixes --- .../collectionFreeForm/CollectionFreeFormView.tsx | 10 +++++----- .../views/collections/collectionFreeForm/MarqueeView.tsx | 13 ++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src/client/views/collections/collectionFreeForm') diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index d0f65866b..f2b94fabc 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -1312,7 +1312,7 @@ export class CollectionFreeFormView extends CollectionSubView { this._batch = UndoManager.StartBatch('regenerateDrawing'); if (doc) { - const docData = DocCast(doc[DocData]); + const docData = doc[DocData]; const children = DocListCast(docData.data); + this._props.removeDocument?.(doc); this._props.removeDocument?.(children); - // this._props.removeDocument?.(doc); } else { - this._props.removeDocument?.(this._drawing); - // if (this._drawingContainer) this._props.removeDocument?.(this._drawingContainer); + if (this._drawingContainer) this._props.removeDocument?.(this._drawingContainer); } + this._drawing = []; }; @action diff --git a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx index 5aff3ed6f..8560323c9 100644 --- a/src/client/views/collections/collectionFreeForm/MarqueeView.tsx +++ b/src/client/views/collections/collectionFreeForm/MarqueeView.tsx @@ -363,7 +363,7 @@ export class MarqueeView extends ObservableReactComponent, options: DocumentOptions, id?: string) => Doc>, makeGroup: Opt) => { + public static getCollection = action((selected: Doc[], creator: Opt<(documents: Array, options: DocumentOptions, id?: string) => Doc>, makeGroup: Opt, bounds: MarqueeViewBounds) => { const newCollection = creator ? creator(selected, { title: 'nested stack' }) : ((doc: Doc) => { @@ -375,14 +375,13 @@ export class MarqueeView extends ObservableReactComponent Doc.SetContainer(d, newCollection)); - this.hideMarquee(); return newCollection; }); @@ -419,7 +418,7 @@ export class MarqueeView extends ObservableReactComponent