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:
parent
ba7157f155
commit
ce66d753e2
1 changed files with 9 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue