fix: update according to boardgame-core
This commit is contained in:
@@ -65,7 +65,7 @@ export function PromptDialog({ prompt, onSubmit, onCancel }: PromptDialogProps)
|
||||
|
||||
{fields.length > 0 ? (
|
||||
<div className="space-y-3 mb-4">
|
||||
{fields.map(({ param, label }) => (
|
||||
{fields.map(({ param, label }, index) => (
|
||||
<div key={label}>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||
{label}
|
||||
@@ -76,7 +76,7 @@ export function PromptDialog({ prompt, onSubmit, onCancel }: PromptDialogProps)
|
||||
value={values[label] || ''}
|
||||
onInput={(e) => setValues(prev => ({ ...prev, [label]: (e.target as HTMLInputElement).value }))}
|
||||
onKeyDown={(e) => { if (e.key === 'Enter') handleSubmit(); }}
|
||||
autoFocus={fields.indexOf({ param, label }) === 0}
|
||||
autoFocus={index === 0}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user