diff --git a/frontend/src/lib/components/document/WhoWhenSection.svelte b/frontend/src/lib/components/document/WhoWhenSection.svelte
index b5d85a56..ff8a044b 100644
--- a/frontend/src/lib/components/document/WhoWhenSection.svelte
+++ b/frontend/src/lib/components/document/WhoWhenSection.svelte
@@ -16,7 +16,8 @@ let {
initialLocation = '',
initialSenderName = '',
suggestedDateIso = '',
- suggestedSenderName = ''
+ suggestedSenderName = '',
+ autofocus = true
}: {
senderId?: string;
selectedReceivers?: Person[];
@@ -26,6 +27,7 @@ let {
initialSenderName?: string;
suggestedDateIso?: string;
suggestedSenderName?: string;
+ autofocus?: boolean;
} = $props();
let dateDisplay = $state(untrack(() => isoToGerman(initialDateIso)));
@@ -69,7 +71,7 @@ $effect(() => {
oninput={handleDateInput}
placeholder={m.form_placeholder_date()}
maxlength="10"
- autofocus={!initialDateIso}
+ autofocus={autofocus && !initialDateIso}
class="block w-full rounded border border-line p-2 text-sm shadow-sm
{dateInvalid ? 'border-red-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-500' : 'focus:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring'}"
aria-describedby={dateInvalid ? 'date-error' : undefined}
@@ -89,7 +91,7 @@ $effect(() => {
bind:value={senderId}
initialName={initialSenderName}
suggestedName={suggestedSenderName}
- autofocus={!!initialDateIso}
+ autofocus={autofocus && !!initialDateIso}
/>