We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3561fb commit 0db333eCopy full SHA for 0db333e
1 file changed
static/js/app.js
@@ -20,6 +20,14 @@ document.body.addEventListener('htmx:configRequest', function() {
20
// Global handler: when a server response includes HX-Trigger: modalDismiss,
21
// clean up any Bootstrap modal backdrop left behind by OOB swaps that
22
// replaced the modal element before afterRequest could call .hide().
23
+document.body.addEventListener('hidden.bs.modal', function(event) {
24
+ var modal = event.target;
25
+ if (modal.id && modal.id.startsWith('create')) {
26
+ var form = modal.querySelector('form');
27
+ if (form) { form.reset(); }
28
+ }
29
+});
30
+
31
document.body.addEventListener('modalDismiss', function() {
32
document.querySelectorAll('.modal.show').forEach(function(el) {
33
var modal = bootstrap.Modal.getInstance(el);
0 commit comments