diff --git a/src/components/reply-modal/reply-modal.tsx b/src/components/reply-modal/reply-modal.tsx index aae794bd..58768337 100644 --- a/src/components/reply-modal/reply-modal.tsx +++ b/src/components/reply-modal/reply-modal.tsx @@ -163,6 +163,20 @@ const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, s const contentPrefix = `c/${parentCid && Plebbit.getShortCid(parentCid)}\n`; + // enable spellcheck after the prefix is set + useEffect(() => { + if (showReplyModal && textRef.current) { + textRef.current.spellcheck = false; + textRef.current.value = contentPrefix + (selectedText || ''); + + setTimeout(() => { + if (textRef.current) { + textRef.current.spellcheck = true; + } + }, 100); + } + }, [showReplyModal, contentPrefix, selectedText]); + const handleContentInput = (e: React.ChangeEvent) => { const { value } = e.target; if (!value.startsWith(contentPrefix)) { @@ -245,16 +259,7 @@ const ReplyModal = ({ closeModal, showReplyModal, parentCid, postCid, scrollY, s />
-