Page MenuHomePhabricator

D3832.diff
No OneTemporary

D3832.diff

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<HTMLInputElement>) => {
const target = event.currentTarget;
@@ -80,6 +86,7 @@
placeholder={threadNamePlaceholder}
onChange={onChangeName}
disabled={inputDisabled}
+ ref={nameInputRef}
/>
</div>
</div>
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' &&

File Metadata

Mime Type
text/plain
Expires
Fri, Sep 20, 8:19 AM (18 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2147327
Default Alt Text
D3832.diff (1 KB)

Event Timeline