Save on focusout not fucking keyup
This commit is contained in:
@@ -65,10 +65,10 @@ export const SignatureRules = () => {
|
|||||||
<div className="flex-1 overflow-auto p-4 space-y-4">
|
<div className="flex-1 overflow-auto p-4 space-y-4">
|
||||||
<div className="bg-black/20 border border-purple-500/30 rounded p-4 space-y-3">
|
<div className="bg-black/20 border border-purple-500/30 rounded p-4 space-y-3">
|
||||||
<div className="grid grid-cols-1 md:grid-cols-3 gap-3">
|
<div className="grid grid-cols-1 md:grid-cols-3 gap-3">
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Regex (e.g. ^Angel.*Outpost$|Guristas.*)"
|
placeholder="Regex (e.g. ^Angel.*Outpost$|Guristas.*)"
|
||||||
value={creating.regex}
|
value={creating.regex}
|
||||||
onChange={e => setCreating({ ...creating, regex: e.target.value })}
|
onChange={e => setCreating({ ...creating, regex: e.target.value })}
|
||||||
className="font-mono"
|
className="font-mono"
|
||||||
/>
|
/>
|
||||||
@@ -94,15 +94,20 @@ export const SignatureRules = () => {
|
|||||||
<Switch checked={!!r.enabled} onCheckedChange={(v) => handleUpdate(r.id, { enabled: v })} />
|
<Switch checked={!!r.enabled} onCheckedChange={(v) => handleUpdate(r.id, { enabled: v })} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="max-w-0">
|
<TableCell className="max-w-0">
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
value={r.regex}
|
value={r.regex}
|
||||||
onChange={e => handleUpdate(r.id, { regex: e.target.value })}
|
onChange={e => setRules(prev => prev.map(x => x.id === r.id ? { ...x, regex: e.target.value } : x))}
|
||||||
|
onBlur={e => handleUpdate(r.id, { regex: e.currentTarget.value })}
|
||||||
className="font-mono"
|
className="font-mono"
|
||||||
/>
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="max-w-0">
|
<TableCell className="max-w-0">
|
||||||
<Input value={r.note} onChange={e => handleUpdate(r.id, { note: e.target.value })} />
|
<Input
|
||||||
|
value={r.note}
|
||||||
|
onChange={e => setRules(prev => prev.map(x => x.id === r.id ? { ...x, note: e.target.value } : x))}
|
||||||
|
onBlur={e => handleUpdate(r.id, { note: e.currentTarget.value })}
|
||||||
|
/>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="text-right">
|
<TableCell className="text-right">
|
||||||
<Button variant="destructive" onClick={() => handleDelete(r.id)}>Delete</Button>
|
<Button variant="destructive" onClick={() => handleDelete(r.id)}>Delete</Button>
|
||||||
|
Reference in New Issue
Block a user