Submit changes onBlur
This commit is contained in:
parent
9d6f054603
commit
9cb3168097
@ -15,11 +15,6 @@ export default function InlineTextField({ initialValue, onChange }: { initialVal
|
||||
setEditing(false);
|
||||
}
|
||||
|
||||
const onCancel = () => {
|
||||
setValue(initialValue);
|
||||
setEditing(false);
|
||||
}
|
||||
|
||||
function renderForm() {
|
||||
return (
|
||||
<div className="flex flex-row">
|
||||
@ -28,12 +23,9 @@ export default function InlineTextField({ initialValue, onChange }: { initialVal
|
||||
value={value}
|
||||
className="px-2 py-0 h-5 max-w-48"
|
||||
onChange={(e) => setValue(e.target.value)}
|
||||
onBlur={onConfirm}
|
||||
autoFocus
|
||||
/>
|
||||
<>
|
||||
<CheckIcon color='green' className="h-5 w-5 mx-2" onClick={onConfirm} />
|
||||
<XMarkIcon color='red' className="h-5 w-5 mx-2" onClick={onCancel} />
|
||||
</>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user