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,
|
setChatValue,
|
||||||
inputRef,
|
inputRef,
|
||||||
}) {
|
}) {
|
||||||
|
useEffect(() => {
|
||||||
|
if (!lockChat && inputRef.current) {
|
||||||
|
inputRef.current.focus();
|
||||||
|
}
|
||||||
|
},[
|
||||||
|
lockChat,inputRef
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (inputRef.current) {
|
if (inputRef.current) {
|
||||||
inputRef.current.style.height = "inherit"; // Reset the height
|
inputRef.current.style.height = "inherit"; // Reset the height
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue