Skip to content

Commit 796e2f7

Browse files
committed
Revert "3798 client - Replace ‘@’ with ‘$’ when deleting data pill in the mention input"
This reverts commit 7da6183.
1 parent 38d4cab commit 796e2f7

File tree

1 file changed

+4
-44
lines changed

1 file changed

+4
-44
lines changed

client/src/pages/platform/workflow-editor/components/properties/components/property-mentions-input/PropertyMentionsInputEditor.tsx

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {Mention} from '@tiptap/extension-mention';
2525
import {Paragraph} from '@tiptap/extension-paragraph';
2626
import {Placeholder} from '@tiptap/extension-placeholder';
2727
import {Text} from '@tiptap/extension-text';
28-
import {Plugin, TextSelection} from '@tiptap/pm/state';
28+
import {TextSelection} from '@tiptap/pm/state';
2929
import {EditorView} from '@tiptap/pm/view';
3030
import {Editor, EditorContent, useEditor} from '@tiptap/react';
3131
import {StarterKit} from '@tiptap/starter-kit';
@@ -157,38 +157,6 @@ const PropertyMentionsInputEditor = forwardRef<Editor, PropertyMentionsInputEdit
157157
const extensions = useMemo(() => {
158158
const extensions = [
159159
...(controlType === 'RICH_TEXT' ? [StarterKit] : [Document, Paragraph, Text]),
160-
Extension.create({
161-
addProseMirrorPlugins() {
162-
return [
163-
new Plugin({
164-
appendTransaction: (_trs, _oldState, newState) => {
165-
const sel = newState.selection;
166-
167-
if (!sel.empty) {
168-
return null;
169-
}
170-
171-
const $pos = sel.$from;
172-
const before = $pos.nodeBefore;
173-
174-
if (
175-
before &&
176-
before.isText &&
177-
typeof before.text === 'string' &&
178-
before.text.endsWith('@')
179-
) {
180-
const from = $pos.pos - 1;
181-
const to = $pos.pos;
182-
183-
return newState.tr.insertText('$', from, to);
184-
}
185-
return null;
186-
},
187-
}),
188-
];
189-
},
190-
name: 'MentionBackspaceFix',
191-
}),
192160
FormulaMode.configure({
193161
saveNullValue: () => {
194162
if (
@@ -500,17 +468,9 @@ const PropertyMentionsInputEditor = forwardRef<Editor, PropertyMentionsInputEdit
500468
return getContent(editorValue);
501469
}, [editorValue, getContent]);
502470

503-
// Forward editor instance to parent ref when it becomes available
504-
useEffect(() => {
505-
if (!ref) {
506-
return;
507-
}
508-
if (typeof ref === 'function') {
509-
ref(editor);
510-
} else {
511-
(ref as MutableRefObject<Editor | null>).current = editor;
512-
}
513-
}, [editor, ref]);
471+
if (ref) {
472+
(ref as MutableRefObject<Editor | null>).current = editor;
473+
}
514474

515475
useEffect(() => {
516476
if (editor) {

0 commit comments

Comments
 (0)