diff options
| author | bobzel <zzzman@gmail.com> | 2020-09-11 19:37:06 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-09-11 19:37:06 -0400 |
| commit | b81ad33b746387dc785580b719866f479fbd9b30 (patch) | |
| tree | a244be080d833cba61737dd6f5592deb694306e4 /src/client/views/nodes/formattedText | |
| parent | 1df562964b4237edf024c1148f5eed6a23245ad7 (diff) | |
fixed creating text boxes with pre-set text to select that text -- used in treeView outlines
Diffstat (limited to 'src/client/views/nodes/formattedText')
| -rw-r--r-- | src/client/views/nodes/formattedText/FormattedTextBox.tsx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index 3be02aa92..a5e86d672 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -1147,8 +1147,12 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp if (selectOnLoad && !this.props.dontRegisterView) { FormattedTextBox.SelectOnLoad = ""; this.props.select(false); - FormattedTextBox.SelectOnLoadChar && this._editorView!.dispatch(this._editorView!.state.tr.insertText(FormattedTextBox.SelectOnLoadChar)); - FormattedTextBox.SelectOnLoadChar = ""; + if (FormattedTextBox.SelectOnLoadChar) { + FormattedTextBox.SelectOnLoadChar && this._editorView!.dispatch(this._editorView!.state.tr.insertText(FormattedTextBox.SelectOnLoadChar)); + FormattedTextBox.SelectOnLoadChar = ""; + } else if (curText?.Text) { + selectAll(this._editorView!.state, this._editorView?.dispatch); + } } selectOnLoad && this._editorView!.focus(); |
