diff --git a/packages/commonwealth/client/scripts/views/components/Comments/CommentEditor/CommentEditor.scss b/packages/commonwealth/client/scripts/views/components/Comments/CommentEditor/CommentEditor.scss index 0d9bf31067b..eb4251dd982 100644 --- a/packages/commonwealth/client/scripts/views/components/Comments/CommentEditor/CommentEditor.scss +++ b/packages/commonwealth/client/scripts/views/components/Comments/CommentEditor/CommentEditor.scss @@ -14,6 +14,11 @@ display: flex; gap: 4px; + .caption { + display: inline-block; + vertical-align: baseline; + } + .user-link-text { &.disabled { .user-display-name { @@ -50,4 +55,4 @@ .token-req-text.Text { color: $neutral-500; } -} \ No newline at end of file +} diff --git a/packages/commonwealth/client/scripts/views/components/react_quill_editor/react_quill_editor.tsx b/packages/commonwealth/client/scripts/views/components/react_quill_editor/react_quill_editor.tsx index 85359701e32..749337cc28a 100644 --- a/packages/commonwealth/client/scripts/views/components/react_quill_editor/react_quill_editor.tsx +++ b/packages/commonwealth/client/scripts/views/components/react_quill_editor/react_quill_editor.tsx @@ -92,8 +92,11 @@ const ReactQuillEditor = ({ const formFieldErrorMessage = hookToForm && name && - (formContext?.formState?.errors?.[name] as SerializableDeltaStatic) - ?.ops?.[0]?.insert?.message; + ( + formContext?.formState?.errors?.[ + name + ] as unknown as SerializableDeltaStatic + )?.ops?.[0]?.insert?.message; const isHookedToFormProper = hookToForm && name && formContext; diff --git a/packages/commonwealth/client/scripts/views/pages/discussions/CommentTree/CommentTree.tsx b/packages/commonwealth/client/scripts/views/pages/discussions/CommentTree/CommentTree.tsx index 358ebb4063b..5c67aa18d50 100644 --- a/packages/commonwealth/client/scripts/views/pages/discussions/CommentTree/CommentTree.tsx +++ b/packages/commonwealth/client/scripts/views/pages/discussions/CommentTree/CommentTree.tsx @@ -155,6 +155,7 @@ export const CommentTree = ({ }); const scrollToRef = useRef(null); + const scrollToEditorRef = useRef(null); const scrollToElement = () => { if (scrollToRef.current) { @@ -166,6 +167,17 @@ export const CommentTree = ({ } }; + const scrollToEditor = () => { + // @ts-expect-error + scrollToEditorRef.current?.scrollIntoView({ behavior: 'smooth' }); + }; + + useEffect(() => { + if (isReplying) { + scrollToEditor(); + } + }, [isReplying]); + // eslint-disable-next-line @typescript-eslint/no-shadow const handleIsReplying = (isReplying: boolean, id?: number) => { if (isReplying) { @@ -525,12 +537,15 @@ export const CommentTree = ({
{isReplying && parentCommentId === comment.id && ( - + <> + +
+ )} );