ux: auto-focus the chat input box (#3941)

* ux: auto-focus the chat input box and search box when switching between pages and thread lists

* chore: remove autofocus hub
This commit is contained in:
Faisal Amir 2024-11-04 14:57:09 +07:00 committed by GitHub
parent 3c721cb97d
commit 755b2f234b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -269,10 +269,13 @@ const RichTextEditor = ({
) )
useEffect(() => { useEffect(() => {
if (!ReactEditor.isFocused(editor)) {
ReactEditor.focus(editor)
}
if (textareaRef.current) { if (textareaRef.current) {
textareaRef.current.focus() textareaRef.current.focus()
} }
}, [activeThreadId]) }, [activeThreadId, editor])
useEffect(() => { useEffect(() => {
if (textareaRef.current?.clientHeight) { if (textareaRef.current?.clientHeight) {