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:
parent
71a9524478
commit
ffff5720d8
2 changed files with 7 additions and 2 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -49,8 +49,6 @@ export function AppWrapperPage() {
|
|||
|
||||
const [retryCount, setRetryCount] = useState(0);
|
||||
|
||||
console.log(healthCheckMaxRetries);
|
||||
|
||||
useEffect(() => {
|
||||
const isServerBusy =
|
||||
(error as AxiosError)?.response?.status === 503 ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue