Skip to content

Commit

Permalink
Fix Homepage layout
Browse files Browse the repository at this point in the history
When the Javascript added the Copy code link, the
`govuk-summary-list__row--no-actions` class remained in place, which
left an unsightly gap on the right hand side. This updates the JS to
remove the class once we have appended the action element, meaning the
gap is no longer there
  • Loading branch information
pezholio committed Nov 21, 2024
1 parent d22c0e6 commit de93ba5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {}
dd.append(this.copyLink)

this.module.append(dd)
this.module.classList.remove('govuk-summary-list__row--no-actions')
}

CopyEmbedCode.prototype.createLink = function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ describe('GOVUK.Modules.CopyEmbedCode', function () {
expect(copyLink.textContent).toBe('Copy code')
})

it('should remove the .govuk-summary-list__row--no-actions class', function () {
expect(fixture.classList).not.toContain(
'govuk-summary-list__row--no-actions'
)
})

it('should create and populate a textarea', function () {
window.GOVUK.triggerEvent(copyLink, 'click')

Expand Down

0 comments on commit de93ba5

Please sign in to comment.