diff --git a/autoform-events.js b/autoform-events.js index a4b865c6..729983f8 100644 --- a/autoform-events.js +++ b/autoform-events.js @@ -449,8 +449,11 @@ Template.autoForm.events({ return } - const formId = event.target.closest('form').id - if (formId !== this.id) return + const parentForm = event.target.form ?? event.target.closest('form') + const formId = parentForm.getAttribute('id') + const expectedId = this.id + + if (formId !== expectedId) return // Some plugins, like jquery.inputmask, can cause infinite // loops by continually saying the field changed when it did not,