Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Summary component init function is monkeypatched in GOV.UK Design System #1666

Closed
lfdebrux opened this issue May 13, 2021 · 1 comment · Fixed by #2039
Closed

Error Summary component init function is monkeypatched in GOV.UK Design System #1666

lfdebrux opened this issue May 13, 2021 · 1 comment · Fixed by #2039

Comments

@lfdebrux
Copy link
Member

Copied from Trello ticket https://trello.com/c/VIpSULRT/

Cause

Error summary component by default takes focus on page load; for examples in the Design System pages this is not desirable, so the behaviour is overridden:

this.$module.addEventListener('click', ErrorSummary.prototype.handleClick.bind(this))

Consequences

  • Risk of breaking the error summary examples in the Design System if we updated the init function or refactored the component such that the patched function no longer worked correctly.
  • Risk of missing functionality in the Design System if we added new functionality and forgot to update the patched init function.

Impact of debt

Low, as it should only really affect us.

Effort to pay down

Low, though we do need to work out a way to deal with this holistically.

Overall rating

Medium

@lfdebrux lfdebrux added awaiting triage Needs triaging by team tech debt labels May 13, 2021
@vanitabarrett vanitabarrett added error summary examples and removed awaiting triage Needs triaging by team labels Sep 23, 2021
@vanitabarrett
Copy link
Contributor

Once alphagov/govuk-frontend#2494 has been released, we should be able to remove this code and use the disableAutoFocus macro option in the error summary component itself instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

2 participants