fix: Ensure Correct Focus on Playground Chat Input (#3582)

 (textAreaWrapper/index.tsx): add useEffect hook to focus on input when conditions are met
♻️ (AppWrapperPage/index.tsx): remove unnecessary console.log statement
This commit is contained in:
Cristhian Zanforlin Lousa 2024-08-28 09:50:48 -03:00 committed by GitHub
commit ffff5720d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,4 @@
import { useEffect } from "react";
import { Textarea } from "../../../../../../../components/ui/textarea";
import { classNames } from "../../../../../../../utils/utils";
@ -43,6 +44,12 @@ const TextAreaWrapper = ({
const additionalClassNames = "form-modal-lockchat pl-14";
useEffect(() => {
if (!lockChat && !noInput && !saveLoading) {
inputRef.current?.focus();
}
}, [lockChat, noInput, saveLoading]);
return (
<Textarea
data-testid="input-chat-playground"

View file

@ -49,8 +49,6 @@ export function AppWrapperPage() {
const [retryCount, setRetryCount] = useState(0);
console.log(healthCheckMaxRetries);
useEffect(() => {
const isServerBusy =
(error as AxiosError)?.response?.status === 503 ||