From 00987c67710bb129080632f5df5ec1172bf0a527 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 27 Aug 2021 10:35:46 +0000 Subject: [PATCH] Bug 28903: Tab key and drop-down menu in item module This patch changes the default configuration of Select2 menus so that the tab key can be used to choose an option which has been highlighted using arrow keys. To reproduce the behavior this fixes, open a page with Select2 menus, e.g. additem.pl: 1. Tab to a Select2 field (withdrawn, lost, damaged, etc.) 2. Hit ENTER. 3. Use arrow key to highlight option. 4. Hit TAB -> Option is NOT selected. 5. Hit tab key -> Focus moves to next input. Apply the patch and test again. At step 4 the tab key should work to select the option you've highlighted. --- koha-tmpl/intranet-tmpl/prog/js/select2.js | 1 + 1 file changed, 1 insertion(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/select2.js b/koha-tmpl/intranet-tmpl/prog/js/select2.js index 0b68c3fd28..c0d9939285 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/select2.js +++ b/koha-tmpl/intranet-tmpl/prog/js/select2.js @@ -2,6 +2,7 @@ $.fn.select2.defaults.set("allowClear", true); $.fn.select2.defaults.set("placeholder", ""); $.fn.select2.defaults.set("width", "element" ); +$.fn.select2.defaults.set("selectOnClose", true ); // Internationalization $.fn.select2.defaults.set("language", { -- 2.20.1