Implement drag and drop #21

Merged
Siklos merged 4 commits from dev.dragdrop into dev 2022-08-09 06:08:05 -04:00
Showing only changes of commit 581f1ca77e - Show all commits

View file

@ -248,9 +248,11 @@ class Editor extends React.Component<IEditorProps> {
} }
let x = 0; let x = 0;
const lastChild: IContainerModel | undefined = parentClone.children.at(-1); if (index !== 0) {
if (lastChild !== undefined) { const lastChild: IContainerModel | undefined = parentClone.children.at(index - 1);
x = lastChild.properties.x + Number(lastChild.properties.width); if (lastChild !== undefined) {
x = lastChild.properties.x + Number(lastChild.properties.width);
}
} }
// Create the container // Create the container