diff options
| author | monoguitari <113245090+monoguitari@users.noreply.github.com> | 2023-02-22 17:44:57 -0500 |
|---|---|---|
| committer | monoguitari <113245090+monoguitari@users.noreply.github.com> | 2023-02-22 17:44:57 -0500 |
| commit | f69406d8566fc0e66597e343ef9b7e9eb893556c (patch) | |
| tree | e93d6a7476dd6947fc3a31c354d9c80e37c14803 /src/client/views/SidebarAnnos.tsx | |
| parent | d565105fe0112d49092f23bd91167b8db2772b91 (diff) | |
| parent | 99b63e35ddf40fc1a69d50059b72275ce23ac43e (diff) | |
Merge branch 'master' into menushortcuts-jesus
Diffstat (limited to 'src/client/views/SidebarAnnos.tsx')
| -rw-r--r-- | src/client/views/SidebarAnnos.tsx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/client/views/SidebarAnnos.tsx b/src/client/views/SidebarAnnos.tsx index 6d06bbbf6..b9af28413 100644 --- a/src/client/views/SidebarAnnos.tsx +++ b/src/client/views/SidebarAnnos.tsx @@ -88,6 +88,7 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> { }; }); + if (!anchor.text) Doc.GetProto(anchor).text = '-selection-'; const textLines: any = [ { type: 'paragraph', @@ -121,16 +122,18 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> { content: taggedContent, }; if (taggedContent.length) textLines.push(metadatatext); - Doc.GetProto(target).text = new RichTextField( - JSON.stringify({ - doc: { - type: 'doc', - content: textLines, - }, - selection: { type: 'text', anchor: 4, head: 4 }, // set selection to middle paragraph - }), - '' - ); + if (textLines.length) { + Doc.GetProto(target).text = new RichTextField( + JSON.stringify({ + doc: { + type: 'doc', + content: textLines, + }, + selection: { type: 'text', anchor: 4, head: 4 }, // set selection to middle paragraph + }), + '' + ); + } this.addDocument(target); setTimeout(() => this._stackRef.current?.focusDocument(target, {})); return target; @@ -233,7 +236,7 @@ export class SidebarAnnos extends React.Component<FieldViewProps & ExtraProps> { isAnnotationOverlay={false} select={emptyFunction} NativeDimScaling={returnOne} - childShowTitle={this.showTitle} + //childShowTitle={this.showTitle} childDocumentsActive={this.props.isContentActive} whenChildContentsActiveChanged={this.props.whenChildContentsActiveChanged} childHideDecorationTitle={returnTrue} |
