diff options
author | bobzel <zzzman@gmail.com> | 2022-08-05 15:02:12 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-08-05 15:02:12 -0400 |
commit | 57f51df7037ff925ebcd30d1060daa2639dfe35f (patch) | |
tree | 7923fb8cc0af6f04c7c3de060623222de6aed0d2 | |
parent | 51851e8f51f1700757119a09121db20c581a8325 (diff) |
fix for adding groups to update schema headers properly
-rw-r--r-- | src/client/views/collections/CollectionNoteTakingView.tsx | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx index ec849d89d..5c8b10ae1 100644 --- a/src/client/views/collections/CollectionNoteTakingView.tsx +++ b/src/client/views/collections/CollectionNoteTakingView.tsx @@ -590,13 +590,8 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti @undoBatch @action addGroup = (value: string) => { - if (value && this.columnHeaders) { - this.resizeColumns(this.columnHeaders.length + 1); - const schemaHdrField = new SchemaHeaderField(value); - this.columnHeaders.push(schemaHdrField); - return true; - } - return false; + const columnHeaders = Cast(this.props.Document.columnHeaders, listSpec(SchemaHeaderField), null); + return value && columnHeaders?.push(new SchemaHeaderField(value)) ? true : false; }; sortFunc = (a: [SchemaHeaderField, Doc[]], b: [SchemaHeaderField, Doc[]]): 1 | -1 => { |