demarches-normaliennes/patches/@hotwired+turbo+7.1.0.patch

33 lines
1.7 KiB
Diff
Raw Normal View History

diff --git a/node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js b/node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js
index 963422f..65364f1 100644
--- a/node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js
+++ b/node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js
@@ -2621,9 +2621,9 @@ class Session {
form.addEventListener("turbo:submit-start", () => form.remove());
}
else {
- form.addEventListener("submit", () => form.remove());
+ form.addEventListener("submit", () => setTimeout(() => form.remove(), 500));
}
- document.body.appendChild(form);
+ (document.querySelector('body > [data-turbo="true"]') || document.body).appendChild(form);
return dispatch("submit", { cancelable: true, target: form });
}
else {
diff --git a/node_modules/@hotwired/turbo/dist/turbo.es2017-umd.js b/node_modules/@hotwired/turbo/dist/turbo.es2017-umd.js
index 101db1f..ce43031 100644
--- a/node_modules/@hotwired/turbo/dist/turbo.es2017-umd.js
+++ b/node_modules/@hotwired/turbo/dist/turbo.es2017-umd.js
@@ -2627,9 +2627,9 @@ Copyright © 2021 Basecamp, LLC
form.addEventListener("turbo:submit-start", () => form.remove());
}
else {
- form.addEventListener("submit", () => form.remove());
+ form.addEventListener("submit", () => setTimeout(() => form.remove(), 500));
}
- document.body.appendChild(form);
+ (document.querySelector('body > [data-turbo="true"]') || document.body).appendChild(form);
return dispatch("submit", { cancelable: true, target: form });
}
else {