From 7a5b9170b7a3bddde898ed3c90ccfc816ae97503 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 27 Sep 2021 12:48:54 +0100 Subject: [PATCH] Bug 28937: (QA follow-up) Accessability improvement This patch adds a keydown event listener onto the flatpickr instance and looks for the down arrow key. When such an event is detected we take that to mean the user wants to keyboard navigate the calendar widget and so disable the buggy allowInput option allowing keyboard navigation to work as expected. --- koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc index bdb793ca671..0718dc3e6dc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc @@ -47,7 +47,12 @@ .addClass("fa fa-fw fa-remove") .attr("aria-hidden", true) .attr("aria-label", _("Clear date") ) - ); + ).keydown(function(e) { + var key = (event.keyCode ? event.keyCode : event.which); + if ( key == 40 ) { + instance.set('allowInput',false); + } + }); }, onClose: function( selectedDates, dateText, instance) { validate_date( selectedDates, instance ); @@ -66,6 +71,7 @@ validate_date( selectedDates, instance ); }, }); + }); [% END %] -- 2.20.1