aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-08-28 09:34:52 -0400
committerbob <bcz@cs.brown.edu>2019-08-28 09:34:52 -0400
commitbe517c301997b617ba642d7f0745a254a6510bf1 (patch)
tree173195319b1b064ddfac4daea89ef5817c09371d /src
parent3dba9c0fdaaaa65339190aa0126b3b1cf1b2ffa1 (diff)
fixed initial storedmarks
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index 36740fc66..1c5224e12 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -628,6 +628,10 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe
this.props.select(false);
}
else if (this.props.isOverlay) this._editorView!.focus();
+ var markerss = this._editorView!.state.storedMarks || (this._editorView!.state.selection.$to.parentOffset && this._editorView!.state.selection.$from.marks());
+ let newMarks = [...(markerss ? markerss.filter(m => m.type !== schema.marks.user_mark) : []), schema.marks.user_mark.create({ userid: Doc.CurrentUserEmail })];
+ this._editorView!.state.storedMarks = newMarks;
+
}
componentWillUnmount() {