Bug 26808: Improve tab key access to circulation confirmation dialog
authorOwen Leonard <oleonard@myacpl.org>
Sat, 24 Oct 2020 01:39:56 +0000 (01:39 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 2 Nov 2020 08:00:08 +0000 (09:00 +0100)
commitddc3459ba5e72f0619a42dacd0f027998f6d3f81
tree5b9937bbaf9a8a462b4881e8d7c183eb6a987fc6
parent4d92e3d284e392ad681b095c02965fe57a85a5a1
Bug 26808: Improve tab key access to circulation confirmation dialog

This patch modifies the checkout template so that the checkout
confirmation message can receive focus, improving tab access to the form
buttons in the dialog.

A "-1" value "tabindex" attribute makes the dialog focusable, and a
"focus" class automatically triggers focus. The focus and tabindex are
only set when the template logic says that the alert will require
confirmation.

To test, apply the patch and open a patron's account for checkout.

- Submit a barcode for checkout which will trigger a confirmation
  dialog. For instance:
  - A barcode they already have checked out
  - A barcode which is checked out to another patron
- When the page reloads you should see an alert-style dialog, "Please
  confirm checkout." The browser should show a focus outline around the
  dialog.
- Hitting the tab key should move the focus to the first focusable
  element inside the dialog. If there is a link in the text, this may be
  the first element. If not the confirmation button should be the next
  tabbable element.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt