aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MainOverlayTextBox.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-08-27 21:20:52 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-08-27 21:20:52 -0400
commita7515d1e80e32fcc19096c73335f624042b85d51 (patch)
tree4ac32d66a97f808c5c5191cc2d420a2e34b70942 /src/client/views/MainOverlayTextBox.tsx
parent5da0459ad76c614e455ea99798c940d4e93707bb (diff)
added auto-reformatting after shift-tab.
Diffstat (limited to 'src/client/views/MainOverlayTextBox.tsx')
-rw-r--r--src/client/views/MainOverlayTextBox.tsx10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/client/views/MainOverlayTextBox.tsx b/src/client/views/MainOverlayTextBox.tsx
index f15b60347..755e5de14 100644
--- a/src/client/views/MainOverlayTextBox.tsx
+++ b/src/client/views/MainOverlayTextBox.tsx
@@ -50,14 +50,8 @@ export class MainOverlayTextBox extends React.Component<MainOverlayTextBoxProps>
(box?: FormattedTextBox) => {
const tb = this._textBox;
const container = tb && tb.props.ContainingCollectionView;
- if (tb && container) { // this hacky section is needed to force the edited text box to completely recreate itself since things can get out synch -- specifically, the bullet label state which is computed when the dom elements are created
- var dl = DocListCast(container.props.Document[container.props.fieldKey]);
- let dli = dl.indexOf(tb.props.Document);
- if (dli !== -1) {
- let prev = dli > 0 ? dl[dli - 1] : undefined;
- tb.props.removeDocument && tb.props.removeDocument(tb.props.Document);
- setTimeout(() => Doc.AddDocToList(container.props.Document, container.props.fieldKey, tb.props.Document, prev, false, dli === 0), 0);
- }
+ 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) {