aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/nodes/formattedText/DailyJournal.tsx12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/client/views/nodes/formattedText/DailyJournal.tsx b/src/client/views/nodes/formattedText/DailyJournal.tsx
index da96b8b2f..f308d45a8 100644
--- a/src/client/views/nodes/formattedText/DailyJournal.tsx
+++ b/src/client/views/nodes/formattedText/DailyJournal.tsx
@@ -159,12 +159,18 @@ export class DailyJournal extends ViewBoxAnnotatableComponent<FieldViewProps>()
state.doc.descendants((node, pos) => {
if (node.isText && node.text === textToRemove) {
- // Remove the predictive text node
const tr = state.tr.delete(pos, pos + node.nodeSize);
+
+ // Set the desired default marks for future input
+ const fontSizeMark = state.schema.marks.pFontSize.create({ fontSize: '14px' });
+ const fontColorMark = state.schema.marks.pFontColor.create({ fontColor: 'gray' });
+ tr.setStoredMarks([]);
+ tr.setStoredMarks([fontSizeMark, fontColorMark]);
+
dispatch(tr);
+
this.predictiveText = null;
- found = true;
- return false; // stop traversal
+ return false;
}
return true;
});