Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3376987
D3832.id12079.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3832.id12079.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 3:15 AM (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2592573
Default Alt Text
D3832.id12079.diff (1 KB)
Attached To
Mode
D3832: [web] Add `nameInputRef` back to `ThreadSettingsGeneralTab`
Attached
Detach File
Event Timeline
Log In to Comment