копирование элемента по ctrl+c и ctrl+v
This commit is contained in:
@@ -578,6 +578,15 @@ export const ElementConstructor: React.FC<ElementConstructorProps> = ({
|
||||
resetForm()
|
||||
}
|
||||
|
||||
const handleElementCopy = (element: Omit<TemplateElement, 'id'>) => {
|
||||
const newElement: TemplateElement = {
|
||||
...element,
|
||||
id: Date.now().toString(),
|
||||
order: elements.length,
|
||||
}
|
||||
onElementAdd(newElement)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex h-full w-full flex-col bg-background">
|
||||
<ElementFormulaBar
|
||||
@@ -611,6 +620,7 @@ export const ElementConstructor: React.FC<ElementConstructorProps> = ({
|
||||
onElementDelete={handleDeleteAndSelect}
|
||||
onLayoutSettingsChange={onLayoutSettingsChange || (() => {})}
|
||||
onElementEdit={handleEditElement}
|
||||
onElementAdd={handleElementCopy}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user