diff options
author | bob <bcz@cs.brown.edu> | 2019-08-27 15:46:03 -0400 |
---|---|---|
committer | bob <bcz@cs.brown.edu> | 2019-08-27 15:46:03 -0400 |
commit | 34e0b1cf34474ec6765e212b6a35defefbfb49c9 (patch) | |
tree | 40c43a94ef3f041ad5b33010d2fb40a36aba37fc /src/client/views/nodes/FormattedTextBox.tsx | |
parent | 0341f6bb0d23e32ba2cb632fec3bf365ccd10047 (diff) |
removed selectOnLoad prop. fixed textboxes from deselecting on carriage return.
Diffstat (limited to 'src/client/views/nodes/FormattedTextBox.tsx')
-rw-r--r-- | src/client/views/nodes/FormattedTextBox.tsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx index acfd2a3b8..c28bf1821 100644 --- a/src/client/views/nodes/FormattedTextBox.tsx +++ b/src/client/views/nodes/FormattedTextBox.tsx @@ -622,12 +622,15 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe } } - if (this.props.selectOnLoad) { - if (!this.props.isOverlay) this.props.select(false); - else this._editorView!.focus(); + if (this.props.Document[Id] == FormattedTextBox.SelectOnLoad) { + FormattedTextBox.SelectOnLoad = ""; + this.props.select(false); } + else if (this.props.isOverlay) this._editorView!.focus(); } + public static SelectOnLoad = ""; + componentWillUnmount() { this._editorView && this._editorView.destroy(); this._reactionDisposer && this._reactionDisposer(); |