From 7e7bb0c67de857643178e4c64671362c0f97584f Mon Sep 17 00:00:00 2001 From: Pea Tyczynska Date: Thu, 10 Sep 2020 15:57:00 +0100 Subject: [PATCH] Turn autofocus on for link-service-to-organisation Accessibility audit uncovered issues screen-reader users would have with autofocus on Notify pages. Autofocus can lead to confusion for those types of users and make them miss parts of the page. Hence, we decided that autofocus will be turned off by default for live-search component. We decided to keep the autofocus on for live-search text box when: 1. the page is a task page - as opposed to browsing pages, where user wonders freely, task pages have more established flow, so page focusing on textbox can actually be helpful. 2. page does not have actionable elements above the autofocus. --- .../link-service-to-organisation.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/templates/views/service-settings/link-service-to-organisation.html b/app/templates/views/service-settings/link-service-to-organisation.html index 975d1d4d1..2b50edee5 100644 --- a/app/templates/views/service-settings/link-service-to-organisation.html +++ b/app/templates/views/service-settings/link-service-to-organisation.html @@ -5,17 +5,24 @@ {% from "components/live-search.html" import live_search %} {% from "components/form.html" import form_wrapper %} +{% set page_title = "Link service to organisation" %} + {% block service_page_title %} - Link service to organisation + {{ page_title }} {% endblock %} {% block maincolumn_content %} {{ page_header( - 'Link service to organisation', + page_title, back_link=url_for('.service_settings', service_id=current_service.id) ) }} - {{ live_search(target_selector='.multiple-choice', show=True, form=search_form, label='Search by name') }} + {{ live_search( + target_selector='.multiple-choice', + show=True, form=search_form, + label='Search by name', + autofocus=True + ) }} {% call form_wrapper() %} {% if has_organisations %} {{ radios(form.organisations) }}