From 9d3ff7f35fcd810a981334ffa994d14b43957561 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 17 Apr 2024 19:36:11 -0400 Subject: [PATCH] fix: Auto-focus name input on collection create/edit --- app/components/Collection/CollectionForm.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/components/Collection/CollectionForm.tsx b/app/components/Collection/CollectionForm.tsx index 69f9dcea1..26faae15c 100644 --- a/app/components/Collection/CollectionForm.tsx +++ b/app/components/Collection/CollectionForm.tsx @@ -71,6 +71,10 @@ export const CollectionForm = observer(function CollectionForm_({ } }, [values.name, collection]); + React.useEffect(() => { + setTimeout(() => setFocus("name", { shouldSelect: true }), 100); + }, [setFocus]); + const handleIconPickerChange = React.useCallback( (color: string, icon: string) => { if (icon !== values.icon) { @@ -108,6 +112,7 @@ export const CollectionForm = observer(function CollectionForm_({ icon={values.icon} /> } + autoComplete="off" autoFocus flex />