fix(web): stop question answers from resetting the editor caret (#11337)

This commit is contained in:
shivam authored and GitHub committed 2026-10-14 07:32:13 +05:30
1 parent 109aaae6cd
commit dff750b1b8
1 file changed
+4 -16
+4 -16
View File
@@ -10428,13 +10428,7 @@ export default function ChatView(props: ChatViewProps) {
);
const onChangeActivePendingUserInputCustomAnswer = useCallback(
(
questionId: string,
value: string,
nextCursor: number,
expandedCursor: number,
_cursorAdjacentToMention: boolean,
) => {
(questionId: string, value: string) => {
if (!activePendingUserInput) {
return;
}
@@ -10454,16 +10448,10 @@ export default function ChatView(props: ChatViewProps) {
),
},
}));
const snapshot = composerRef.current?.readSnapshot();
if (
snapshot?.value !== value ||
snapshot.cursor !== nextCursor ||
snapshot.expandedCursor !== expandedCursor
) {
composerRef.current?.focusAt(nextCursor);
}
// The editor owns this selection. Resetting it before the answer renders
// can re-enter Lexical with offsets from the previous skill token.
},
[activePendingUserInput, activePendingRequestKey, composerRef],
[activePendingUserInput, activePendingRequestKey],
);
const onAdvanceActivePendingUserInput = useCallback(() => {