aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/collectionFreeForm/CollectionFreeFormClusters.ts
diff options
context:
space:
mode:
authorgeireann <geireann.lindfield@gmail.com>2024-10-31 10:45:12 -0400
committergeireann <geireann.lindfield@gmail.com>2024-10-31 10:45:12 -0400
commitd234aebe441aced1b6d947653a1b36c226439103 (patch)
tree237f69defbcbdec1a3f3e10225d1613dc261531a /src/client/views/collections/collectionFreeForm/CollectionFreeFormClusters.ts
parent6b070202843e1e2a11c09c4d29aee4ab8750f31f (diff)
parent311836b7a013d37dccb7b74d7ce787cea448de38 (diff)
Merge branch 'master' of https://github.com/brown-dash/Dash-Web
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormClusters.ts')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormClusters.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormClusters.ts b/src/client/views/collections/collectionFreeForm/CollectionFreeFormClusters.ts
index 6ad67a864..8530f7a23 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormClusters.ts
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormClusters.ts
@@ -1,4 +1,4 @@
-import { action, observable } from 'mobx';
+import { action, observable, untracked } from 'mobx';
import { CollectionFreeFormView } from '.';
import { intersectRect } from '../../../../Utils';
import { Doc, Opt } from '../../../../fields/Doc';
@@ -179,7 +179,9 @@ export class CollectionFreeFormClusters {
};
styleProvider = (doc: Opt<Doc>, props: Opt<FieldViewProps>, property: string) => {
- if (doc && this.childDocs?.includes(doc))
+ // without untracked, every inquired style property for any Doc will be invalidated if a change is made to the collection's childDocs.
+ // this prevents that by assuming that a Doc is generally always (or never) a member of childDocs - if it's removed or added, then all of its properties get updated anyway.
+ if (doc && untracked(() => this.childDocs)?.includes(doc))
switch (property.split(':')[0]) {
case StyleProp.BackgroundColor:
{