docs: fix search not opening sometimes (#13118)

This commit is contained in:
Shahed Nasser
2025-08-01 12:29:44 +03:00
committed by GitHub
parent b0d0e7b1a6
commit 714087ca5a
2 changed files with 8 additions and 4 deletions
@@ -80,7 +80,9 @@ export const AiAssistantChatWindowInput = ({
useEffect(() => { useEffect(() => {
adjustTextareaHeight() adjustTextareaHeight()
inputRef.current?.focus() if (chatOpened) {
inputRef.current?.focus()
}
}, [question]) }, [question])
const handleTouch = (e: React.TouchEvent<HTMLTextAreaElement>) => { const handleTouch = (e: React.TouchEvent<HTMLTextAreaElement>) => {
@@ -131,9 +131,11 @@ const AiAssistantInnerProvider = ({
useEffect(() => { useEffect(() => {
setOnCompleteAction(() => { setOnCompleteAction(() => {
scrollToBottom() scrollToBottom()
inputRef.current?.focus({ if (chatOpened) {
preventScroll: true, inputRef.current?.focus({
}) preventScroll: true,
})
}
}) })
}, [scrollToBottom]) }, [scrollToBottom])