Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add another: fix problem in createRemoveButtons method:
Browse files Browse the repository at this point in the history
- This creates multiple "Delete" buttons
davidtrussler committed Jan 23, 2025

Unverified

The email in this signature doesn’t match the committer email.
1 parent 45fefd5 commit 5bea69c
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
## Unreleased

* Change id validation on component wrapper ([PR #4584](https://github.com/alphagov/govuk_publishing_components/pull/4584))
* Add another: fix problem in createRemoveButtons method ([PR #11719](https://github.com/alphagov/govuk_publishing_components/pull/4586))

## 50.0.0

Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5bea69c

Please sign in to comment.