diff --git a/web/modals/threads/thread-settings-general-tab.react.js b/web/modals/threads/thread-settings-general-tab.react.js --- a/web/modals/threads/thread-settings-general-tab.react.js +++ b/web/modals/threads/thread-settings-general-tab.react.js @@ -28,6 +28,12 @@ setQueuedChanges, } = props; + const nameInputRef = React.useRef(); + + React.useEffect(() => { + nameInputRef.current?.focus(); + }, [inputDisabled]); + const onChangeName = React.useCallback( (event: SyntheticEvent) => { const target = event.currentTarget; @@ -80,6 +86,7 @@ placeholder={threadNamePlaceholder} onChange={onChangeName} disabled={inputDisabled} + ref={nameInputRef} /> diff --git a/web/modals/threads/thread-settings-modal.react.js b/web/modals/threads/thread-settings-modal.react.js --- a/web/modals/threads/thread-settings-modal.react.js +++ b/web/modals/threads/thread-settings-modal.react.js @@ -180,8 +180,6 @@ setAccountPassword(''); setCurrentTabType('general'); setQueuedChanges(Object.freeze({})); - // TODO: nameInput.focus() - // (once ref is moved up to functional component) throw e; } }, [callChangeThreadSettings, modalContext, queuedChanges, threadInfo]); @@ -198,9 +196,6 @@ ); React.useEffect(() => { - // TODO: nameInput.focus() - // (once ref is moved up to functional component) - if ( threadInfo && currentTabType !== 'general' &&