Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raymond UI bugs fix #9219

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
display: flex;
gap: 4px;

.caption {
display: inline-block;
vertical-align: baseline;
}

.user-link-text {
&.disabled {
.user-display-name {
Expand Down Expand Up @@ -50,4 +55,4 @@
.token-req-text.Text {
color: $neutral-500;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export const CommentTree = ({
});

const scrollToRef = useRef(null);
const scrollToEditorRef = useRef(null);

const scrollToElement = () => {
if (scrollToRef.current) {
Expand All @@ -166,6 +167,17 @@ export const CommentTree = ({
}
};

const scrollToEditor = () => {
// @ts-expect-error <StrictNullChecks/>
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) {
Expand Down Expand Up @@ -525,12 +537,15 @@ export const CommentTree = ({
</div>
<div ref={scrollToRef}></div>
{isReplying && parentCommentId === comment.id && (
<CreateComment
handleIsReplying={handleIsReplying}
parentCommentId={parentCommentId}
rootThread={thread}
canComment={canComment}
/>
<>
<CreateComment
handleIsReplying={handleIsReplying}
parentCommentId={parentCommentId}
rootThread={thread}
canComment={canComment}
/>
<div ref={scrollToEditorRef}></div>
</>
)}
</React.Fragment>
);
Expand Down
Loading