mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 12:25:23 +02:00
Fix: prevent keyboard events from closing edit panel
This commit is contained in:
@@ -179,6 +179,10 @@ export function EditPanel({ row, rowIndex, onSave, onClose, onCaptureState }: Ed
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handleInputKeyDown = (e: React.KeyboardEvent) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
};
|
||||||
|
|
||||||
const FieldEditor = ({ title, field }: { title: string, field: keyof typeof formData }) => (
|
const FieldEditor = ({ title, field }: { title: string, field: keyof typeof formData }) => (
|
||||||
<div className="flex flex-col gap-2">
|
<div className="flex flex-col gap-2">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
@@ -213,6 +217,7 @@ export function EditPanel({ row, rowIndex, onSave, onClose, onCaptureState }: Ed
|
|||||||
id={`field-${String(field)}`}
|
id={`field-${String(field)}`}
|
||||||
value={formData[field]}
|
value={formData[field]}
|
||||||
onChange={e => setFormData(prev => ({ ...prev, [field]: e.target.value }))}
|
onChange={e => setFormData(prev => ({ ...prev, [field]: e.target.value }))}
|
||||||
|
onKeyDown={handleInputKeyDown}
|
||||||
className={cn(
|
className={cn(
|
||||||
"w-full h-32 bg-slate-900 border rounded-md p-3 text-sm text-white focus:outline-none focus:ring-1 transition-colors resize-none",
|
"w-full h-32 bg-slate-900 border rounded-md p-3 text-sm text-white focus:outline-none focus:ring-1 transition-colors resize-none",
|
||||||
isModified(field) ? "border-blue-500 focus:ring-blue-500" : "border-slate-700 focus:border-slate-500 focus:ring-slate-500"
|
isModified(field) ? "border-blue-500 focus:ring-blue-500" : "border-slate-700 focus:border-slate-500 focus:ring-slate-500"
|
||||||
|
|||||||
Reference in New Issue
Block a user