Page MenuHomePhabricator

D3832.id11950.diff
No OneTemporary

D3832.id11950.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
Sun, Nov 24, 10:28 AM (21 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574700
Default Alt Text
D3832.id11950.diff (1 KB)

Event Timeline