Skip to content

Commit

Permalink
Add another: fix problem in createRemoveButtons method:
Browse files Browse the repository at this point in the history
- This creates multiple "Delete" buttons
  • Loading branch information
davidtrussler committed Jan 23, 2025
1 parent 8e55b13 commit a6fdfec
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};

AddAnother.prototype.createRemoveButtons = function () {
var fieldsets =
document.querySelectorAll('.js-add-another__fieldset')
this.module.querySelectorAll('.js-add-another__fieldset')
fieldsets.forEach(function (fieldset) {
this.createRemoveButton(fieldset, this.removeExistingFieldset.bind(this))
fieldset.querySelector('.js-add-another__destroy-checkbox').hidden = true
Expand Down

0 comments on commit a6fdfec

Please sign in to comment.