From c0155e743968199df1c2ad4fa0c7d46c7df48479 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. Signed-off-by: Owen Leonard --- 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 bdb793ca67..0718dc3e6d 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