alphagov / govuk-design-system

One place for service teams to find styles, components and patterns for designing government services.
https://www.gov.uk/design-system
MIT License
512 stars 232 forks source link

Only show the site search results separator when input is focused #4253

Closed owenatgov closed 3 weeks ago

owenatgov commented 3 weeks ago

Something we missed in #4220. We control how the separator is displayed via 2 accessible autocompelte states:

  1. the input has aria-expanded="true", indicating it has results
  2. the input has aria-expanded="false" but also no aria-describedby attribute, indicating that the 'no results' dialog is visible

The 2nd state however is also true when a user has entered text into the input and clicked away, resulting in the border being visible when there's no dropdown:

site search with separator when there's no dropdown

This change uses app-site-search__input--focused as an additional hook for that state. We already do something similar for controlling the focus state of the input further down.

netlify[bot] commented 3 weeks ago

You can preview this change here:

Name Link
Latest commit f9cc8a481487806bd85c79aa839d84d04a5528b6
Latest deploy log https://app.netlify.com/sites/govuk-design-system-preview/deploys/6721176c52b38e000726ad83
Deploy Preview https://deploy-preview-4253--govuk-design-system-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.