fix: Unable to scroll until multiple comments (#7112)

* fix: Unable to scroll in comments
fix: Missing highlighted text on first comment while composing

* docs
This commit is contained in:
Tom Moor
2024-06-22 10:05:23 -04:00
committed by GitHub
parent d8f14377f8
commit eaab97dcbf
5 changed files with 43 additions and 27 deletions

View File

@@ -24,6 +24,7 @@ import useOnClickOutside from "~/hooks/useOnClickOutside";
import useStores from "~/hooks/useStores";
import CommentEditor from "./CommentEditor";
import { Bubble } from "./CommentThreadItem";
import { HighlightedText } from "./HighlightText";
type Props = {
/** Callback when the draft should be saved. */
@@ -42,6 +43,8 @@ type Props = {
standalone?: boolean;
/** Whether to animate the comment form in and out */
animatePresence?: boolean;
/** Text to highlight at the top of the comment */
highlightedText?: string;
/** The text direction of the editor */
dir?: "rtl" | "ltr";
/** Callback when the user is typing in the editor */
@@ -64,6 +67,7 @@ function CommentForm({
standalone,
placeholder,
animatePresence,
highlightedText,
dir,
...rest
}: Props) {
@@ -274,6 +278,9 @@ function CommentForm({
$firstOfThread={standalone}
column
>
{highlightedText && (
<HighlightedText>{highlightedText}</HighlightedText>
)}
<CommentEditor
key={`${forceRender}`}
ref={editorRef}