diff options
| author | bobzel <zzzman@gmail.com> | 2024-10-28 20:07:51 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-10-28 20:07:51 -0400 |
| commit | 63f9f9573dab9745d2f570e1917b325a474fdd93 (patch) | |
| tree | 51083d4087aa2b86f8e8d18523e82fb41ce51a3f /src/client/views/collections/collectionFreeForm/CollectionFreeFormClusters.ts | |
| parent | 050fe4fe0d9f9722a7a2a48ae3b446049f93775f (diff) | |
reworked LabelBox's to be fully editable. gor rid of singleLine for label boxes. made a text_fitBox field to render text with a labelBox. fixed styleprovider in freeformview clusters to be untracked() to avoid invalidations. added a default text color to Settings panel. fixed clicking text buttons to not lose focus in labelBox.
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormClusters.ts')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormClusters.ts | 6 |
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: { |
