aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/FormattedTextBox.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-12-03 15:32:57 -0500
committerSam Wilkins <samwilkins333@gmail.com>2019-12-03 15:32:57 -0500
commit24f89a276005e25b1907f9236c5434f6c2e69746 (patch)
tree151302ef29d4fa43b5822ab8512f5009492ff180 /src/client/views/nodes/FormattedTextBox.tsx
parent6b29c8177dae43f5d6a4ccdc2ca5dfc6f60e83eb (diff)
parent9a0787aafb623ce0aa043419533b51378f56e070 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/nodes/FormattedTextBox.tsx')
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index a9f8ea315..88c0c5a2e 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -813,8 +813,9 @@ export class FormattedTextBox extends DocAnnotatableComponent<(FieldViewProps &
if (selectOnLoad) {
FormattedTextBox.SelectOnLoad = "";
this.props.select(false);
- this._editorView!.focus();
}
+ const rtf = doc ? Cast(doc[fieldKey], RichTextField) : undefined;
+ (selectOnLoad || (rtf && !rtf.Text)) && this._editorView!.focus();
// add user mark for any first character that was typed since the user mark that gets set in KeyPress won't have been called yet.
this._editorView!.state.storedMarks = [...(this._editorView!.state.storedMarks ? this._editorView!.state.storedMarks : []), schema.marks.user_mark.create({ userid: Doc.CurrentUserEmail, modified: Math.round(Date.now() / 1000 / 5) })];
}