diff --git a/frontend/main.ts b/frontend/main.ts index 58268db..890decb 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -65,7 +65,8 @@ function initSidebar() { function initTripSidebar(triggerElement: HTMLElement) { const sidebarElement = document.querySelector('#addTrip'); if(sidebarElement && triggerElement.dataset.form && triggerElement.dataset.header) { - let formElement = document.querySelector(triggerElement.dataset.form); + let form = document.querySelector(triggerElement.dataset.form); + let formElement = form.cloneNode(true); let formContainerElement = sidebarElement.querySelector('.form-js'); if(formContainerElement) { formContainerElement.innerHTML = '';