authorgravatar for 91240327+shivamhwp@users.noreply.github.comshivam <91240327+shivamhwp@users.noreply.github.com> 2026-10-14 07:32:13+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-14 07:32:13+05:30
logdff750b1b8818eb004b8c3d060edcdc09f88a07f
tree79122d72f070797991860551f4e930a0b0289917
parent109aaae6cd251e1d3aa595624209758a164d8b33
signature Signed by PGP key B5690EEEBB952194

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


1 files changed, 4 insertions(+), 16 deletions(-)

apps/web/src/components/ChatView.tsx+4-16
......@@ -10428,13 +10428,7 @@ export default function ChatView(props: ChatViewProps) {
1042810428 );
1042910429
1043010430 const onChangeActivePendingUserInputCustomAnswer = useCallback(
10431 (
10432 questionId: string,
10433 value: string,
10434 nextCursor: number,
10435 expandedCursor: number,
10436 _cursorAdjacentToMention: boolean,
10437 ) => {
10431 (questionId: string, value: string) => {
1043810432 if (!activePendingUserInput) {
1043910433 return;
1044010434 }
......@@ -10454,16 +10448,10 @@ export default function ChatView(props: ChatViewProps) {
1045410448 ),
1045510449 },
1045610450 }));
10457 const snapshot = composerRef.current?.readSnapshot();
10458 if (
10459 snapshot?.value !== value ||
10460 snapshot.cursor !== nextCursor ||
10461 snapshot.expandedCursor !== expandedCursor
10462 ) {
10463 composerRef.current?.focusAt(nextCursor);
10464 }
10451 // The editor owns this selection. Resetting it before the answer renders
10452 // can re-enter Lexical with offsets from the previous skill token.
1046510453 },
10466 [activePendingUserInput, activePendingRequestKey, composerRef],
10454 [activePendingUserInput, activePendingRequestKey],
1046710455 );
1046810456
1046910457 const onAdvanceActivePendingUserInput = useCallback(() => {