Skip to content

Commit

Permalink
Associate plugin search input and label
Browse files Browse the repository at this point in the history
The search input on the plugin list page does not have a programatically label because the label is not currently associated with the input.

Rather than using the separate `govukLabel` macro, pass the label options to the  `govukInput` macro and let it take care of associating the label for us.

We can also use the `govuk-label--s` modifier rather than a font weight override.
  • Loading branch information
36degrees committed Feb 26, 2024
1 parent dcf4429 commit 80f0459
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/nunjucks/views/manage-prototype/plugins.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% extends "views/manage-prototype/layout.njk" %}
{% from "govuk/components/button/macro.njk" import govukButton %}
{% from "govuk/components/label/macro.njk" import govukLabel %}
{% from "govuk/components/input/macro.njk" import govukInput %}
{% from "govuk/components/tag/macro.njk" import govukTag %}

Expand Down Expand Up @@ -48,13 +47,12 @@
{% if isSearchPage %}
<div class="govuk-!-margin-bottom-5">
<div id="search-container">
{{ govukLabel({
text:"Search",
classes:"govuk-!-font-weight-bold"
}) }}

{{ govukInput({
id: "search",
label: {
text: "Search",
classes: "govuk-label--s"
},
classes: "govuk-!-width-one-half",
formGroup: {
classes: "govuk-!-margin-bottom-3"
Expand Down

0 comments on commit 80f0459

Please sign in to comment.