feat(chatInput): add useEffect hook to focus on chat input when lockChat is false and inputRef is available

fix(chatInput): remove unnecessary comment in useEffect hook
This commit is contained in:
anovazzi1 2023-06-20 20:49:32 -03:00
commit ce66d753e2

View file

@ -10,6 +10,15 @@ export default function ChatInput({
setChatValue,
inputRef,
}) {
useEffect(() => {
if (!lockChat && inputRef.current) {
inputRef.current.focus();
}
},[
lockChat,inputRef
])
useEffect(() => {
if (inputRef.current) {
inputRef.current.style.height = "inherit"; // Reset the height