diff options
| author | bobzel <zzzman@gmail.com> | 2025-03-24 16:29:32 -0400 | 
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2025-03-24 16:29:32 -0400 | 
| commit | 858f5d2f1621695a703b0e3f8297521c3ebe692d (patch) | |
| tree | 3180f91ee18bf8accef98cbbb6db6688666e8340 /src/client/views/nodes/LabelBox.tsx | |
| parent | 9c5d14fdd562dc1bcc8aa0f73ce7ad189c9fbf23 (diff) | |
| parent | b6cf21b5a52184f89909898d292a79c57c043d7e (diff) | |
Merge branch 'fieldSyntaxUpdate' into aarav_edit
Diffstat (limited to 'src/client/views/nodes/LabelBox.tsx')
| -rw-r--r-- | src/client/views/nodes/LabelBox.tsx | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/src/client/views/nodes/LabelBox.tsx b/src/client/views/nodes/LabelBox.tsx index 7fb83571f..b08ed84b7 100644 --- a/src/client/views/nodes/LabelBox.tsx +++ b/src/client/views/nodes/LabelBox.tsx @@ -13,11 +13,11 @@ import { undoable } from '../../util/UndoManager';  import { ViewBoxBaseComponent } from '../DocComponent';  import { PinDocView, PinProps } from '../PinFuncs';  import { StyleProp } from '../StyleProp'; +import { DocumentView } from './DocumentView';  import { FieldView, FieldViewProps } from './FieldView';  import './LabelBox.scss';  import { FormattedTextBox } from './formattedText/FormattedTextBox';  import { RichTextMenu } from './formattedText/RichTextMenu'; -import { DocumentView } from './DocumentView';  @observer  export class LabelBox extends ViewBoxBaseComponent<FieldViewProps>() { @@ -103,11 +103,11 @@ export class LabelBox extends ViewBoxBaseComponent<FieldViewProps>() {          };          if (r) {              if (!r.offsetHeight || !r.offsetWidth) { -                //console.log("CAN'T FIT TO EMPTY BOX"); -                this._timeout && clearTimeout(this._timeout); +                r.style.opacity = '0';                  this._timeout = setTimeout(() => this.fitTextToBox(r));                  return textfitParams;              } +            r.style.opacity = '1';              r.style.whiteSpace = ''; // textfit sets to nowrap if not multiline, but doesn't reeset if it becomes multiline              r.style.textAlign = StrCast(this.layoutDoc[this.fieldKey + '_align']); // textfit doesn't reset textAlign if it has been set to center, so we just set it to what we want              r.firstChild instanceof HTMLElement && (r.firstChild.style.textAlign = StrCast(this.layoutDoc[this.fieldKey + '_align'])); @@ -222,7 +222,7 @@ export class LabelBox extends ViewBoxBaseComponent<FieldViewProps>() {                              FormattedTextBox.LiveTextUndo = undefined;                          }}                          dangerouslySetInnerHTML={{ -                            __html: `<span class="textFitted textFitAlignVert" style="display: inline-block; text-align: center; font-size: 100px; height: 0px;">${this.Title.startsWith('#') ? null : (this.Title ?? '')}</span>`, +                            __html: `<span class="textFitted textFitAlignVert" style="display: inline-block; text-align: center; font-size: 100px; height: 0px;">${this.Title?.startsWith('#') ? '' : (this.Title ?? '')}</span>`,                          }}                          contentEditable={this._props.onClickScript?.() ? undefined : true}                          ref={r => { @@ -239,7 +239,7 @@ export class LabelBox extends ViewBoxBaseComponent<FieldViewProps>() {                                  if (this.Title) {                                      this.resetCursor();                                  } -                            } +                            } else this._timeout && clearTimeout(this._timeout);                          }}                      />                  </div> | 
