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

Restore behaviour of Back Link component for falsy text and href options #5189

Closed
2 tasks
romaricpascal opened this issue Aug 1, 2024 · 0 comments · Fixed by #5191
Closed
2 tasks

Restore behaviour of Back Link component for falsy text and href options #5189

romaricpascal opened this issue Aug 1, 2024 · 0 comments · Fixed by #5191
Assignees
Labels
back link 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) nunjucks

Comments

@romaricpascal
Copy link
Member

What

Make text and href correctly render default values when a falsy value is passed to the component, and add some tests checking this for undefined/null and different kinds of falsy values 0,'', false.

Why

The use of the default filter means only undefined values are replaced by the default value provided to the filter. This means a '' string as text would make the button render with no content, causing both visual and accessibility issues.

Who needs to work on this

Developers

Who needs to review this

Developers

Done when

  • Default values for text and href render when passed a 'falsy' value
  • Tests have been added for undefined/null and different kinds of falsy values 0,'', false
@romaricpascal romaricpascal added 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) back link nunjucks labels Aug 1, 2024
@romaricpascal romaricpascal changed the title Restore behaviour of Back link component for falsy text and href options Restore behaviour of Back Link component for falsy text and href options Aug 1, 2024
@romaricpascal romaricpascal self-assigned this Aug 2, 2024
@romaricpascal romaricpascal moved this to Needs review 🔍 in GOV.UK Design System cycle board Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back link 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) nunjucks
Projects
Status: Needs review 🔍
Development

Successfully merging a pull request may close this issue.

1 participant