When creating a new element if you accidentally click outside the window for entering the new element information it closes the window and you lose all the information entered. I think that clicking outside that window should do nothing and only the cancel button or save button should close out the window.
Alternatively maybe have a second pop-up window confirming you would like to cancel.