Skip to content

Commit 80ed127

Browse files
committed
fix(event): change event resolves the parent form correctly now
1 parent 910b8d0 commit 80ed127

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

autoform-events.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,11 @@ Template.autoForm.events({
449449
return
450450
}
451451

452-
const formId = event.target.closest('form').id
453-
if (formId !== this.id) return
452+
const parentForm = event.target.form && event.target.closest('form')
453+
const formId = parentForm.getAttribute('id')
454+
const expectedId = this.id
455+
456+
if (formId !== expectedId) return
454457

455458
// Some plugins, like jquery.inputmask, can cause infinite
456459
// loops by continually saying the field changed when it did not,

0 commit comments

Comments
 (0)