From b054d55018010e10b1b2a1e18052cc0ad1148fe8 Mon Sep 17 00:00:00 2001 From: Tobias Hopp Date: Wed, 16 Apr 2025 11:27:39 +0200 Subject: [PATCH] add autofocus for modals --- frontend/src/components/FriendshipNetwork.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/FriendshipNetwork.tsx b/frontend/src/components/FriendshipNetwork.tsx index c435159..943cce6 100644 --- a/frontend/src/components/FriendshipNetwork.tsx +++ b/frontend/src/components/FriendshipNetwork.tsx @@ -51,15 +51,6 @@ interface PersonNode { x: number; y: number; }; } - -interface RelationshipEdge { - _id: string; - source: string; - target: string; - type: RelationshipType; - customType?: string; - notes?: string; -} // Type for form errors interface FormErrors { [key: string]: string; @@ -1150,6 +1141,7 @@ const FriendshipNetwork: React.FC = () => { className={`w-full bg-slate-700 border ${personFormErrors.firstName ? 'border-red-500' : 'border-slate-600'} rounded-md p-2 focus:outline-none focus:ring-2 focus:ring-indigo-500 text-white`} placeholder="Enter first name" + autoFocus={true} value={newPerson.firstName} onChange={e => setNewPerson({ ...newPerson, firstName: e.target.value })} /> @@ -1236,6 +1228,7 @@ const FriendshipNetwork: React.FC = () => { >