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

View File

@@ -80,7 +80,9 @@ export const AiAssistantChatWindowInput = ({
useEffect(() => {
adjustTextareaHeight()
inputRef.current?.focus()
if (chatOpened) {
inputRef.current?.focus()
}
}, [question])
const handleTouch = (e: React.TouchEvent<HTMLTextAreaElement>) => {

View File

@@ -131,9 +131,11 @@ const AiAssistantInnerProvider = ({
useEffect(() => {
setOnCompleteAction(() => {
scrollToBottom()
inputRef.current?.focus({
preventScroll: true,
})
if (chatOpened) {
inputRef.current?.focus({
preventScroll: true,
})
}
})
}, [scrollToBottom])