Skip to content

Commit

Permalink
fix(event): change event resolves the parent form correctly now
Browse files Browse the repository at this point in the history
  • Loading branch information
jankapunkt committed May 2, 2024
1 parent 910b8d0 commit 80ed127
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions autoform-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 80ed127

Please sign in to comment.