fix: make autoFocus a prop on FeedbackForm, only apply in modal context

This commit is contained in:
2026-03-30 20:51:08 -04:00
parent 82a38a7a15
commit 0e4c49928b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ const CATEGORIES = [
{ value: 'GENERAL', label: 'General feedback' },
]
export function FeedbackForm({ onSuccess }: { onSuccess?: () => void }) {
export function FeedbackForm({ onSuccess, autoFocus = false }: { onSuccess?: () => void; autoFocus?: boolean }) {
const [category, setCategory] = useState('BUG')
const [message, setMessage] = useState('')
const [email, setEmail] = useState('')
@@ -64,7 +64,7 @@ export function FeedbackForm({ onSuccess }: { onSuccess?: () => void }) {
value={category}
onChange={(e) => setCategory(e.target.value)}
disabled={status === 'loading'}
autoFocus
autoFocus={autoFocus}
className="w-full appearance-none rounded-lg border border-zinc-800 bg-zinc-950 px-3 py-2.5 text-sm text-zinc-200 focus:border-amber-500/40 focus:outline-none disabled:opacity-50"
>
{CATEGORIES.map((c) => (
+1 -1
View File
@@ -45,7 +45,7 @@ export function FeedbackModal({
<XMarkIcon className="h-5 w-5" />
</button>
</div>
<FeedbackForm onSuccess={onClose} />
<FeedbackForm onSuccess={onClose} autoFocus />
</div>
</div>
)