diff options
author | bob <bcz@cs.brown.edu> | 2019-08-29 13:49:45 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-08-29 13:49:45 -0400 |
commit | e2317289507fd6d20096dc1d2abd5ab1d815e895 (patch) | |
tree | 1a4a98af879b3dc66b5844deec2d9c8917c2fe97 /src/client/views/MainOverlayTextBox.tsx | |
parent | 0b43aead85c0de5877c0ecea7703acb6f2539249 (diff) | |
parent | 22a5999626b11cf75cafbcd421601e668438f6ad (diff) |
Merge branch 'master' into monika_linking
Diffstat (limited to 'src/client/views/MainOverlayTextBox.tsx')
-rw-r--r-- | src/client/views/MainOverlayTextBox.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client/views/MainOverlayTextBox.tsx b/src/client/views/MainOverlayTextBox.tsx index e95e5b777..755e5de14 100644 --- a/src/client/views/MainOverlayTextBox.tsx +++ b/src/client/views/MainOverlayTextBox.tsx @@ -2,7 +2,7 @@ import { action, observable, reaction, trace } from 'mobx'; import { observer } from 'mobx-react'; import "normalize.css"; import * as React from 'react'; -import { Doc } from '../../new_fields/Doc'; +import { Doc, DocListCast } from '../../new_fields/Doc'; import { BoolCast } from '../../new_fields/Types'; import { emptyFunction, returnTrue, returnZero, Utils, returnOne } from '../../Utils'; import { DragManager } from '../util/DragManager'; @@ -42,13 +42,17 @@ export class MainOverlayTextBox extends React.Component<MainOverlayTextBoxProps> return this._textBox && this._textBox.setFontColor(color); } - constructor(props: MainOverlayTextBoxProps) { super(props); this._textProxyDiv = React.createRef(); MainOverlayTextBox.Instance = this; reaction(() => FormattedTextBox.InputBoxOverlay, (box?: FormattedTextBox) => { + const tb = this._textBox; + const container = tb && tb.props.ContainingCollectionView; + if (tb && container) { + tb.rebuildEditor();// this forces the edited text box to completely recreate itself to avoid get out of sync -- e.g., bullet labels are only computed when the dom elements are created + } this._textBox = box; if (box) { this.ChromeHeight = box.props.ChromeHeight; @@ -146,7 +150,7 @@ export class MainOverlayTextBox extends React.Component<MainOverlayTextBoxProps> DataDoc={FormattedTextBox.InputBoxOverlay.props.DataDoc} onClick={undefined} ChromeHeight={this.ChromeHeight} - isSelected={returnTrue} select={emptyFunction} renderDepth={0} selectOnLoad={true} + isSelected={returnTrue} select={emptyFunction} renderDepth={0} ContainingCollectionView={undefined} whenActiveChanged={emptyFunction} active={returnTrue} ContentScaling={returnOne} ScreenToLocalTransform={this._textXf} PanelWidth={returnZero} PanelHeight={returnZero} focus={emptyFunction} pinToPres={returnZero} addDocTab={this.addDocTab} outer_div={(tooltip: HTMLElement) => { this._tooltip = tooltip; this.updateTooltip(); }} /> |