From dcfc7691d664393256e90b85de43f1b8b52aaf87 Mon Sep 17 00:00:00 2001 From: Jake Deery Date: Thu, 2 Oct 2025 12:46:57 +0000 Subject: [PATCH] Bug 41200: Refocuses add to cart after removal This patch hopes to resolve disappearing focus when one clicks 'remove' on a present card item on the results page, by pushing the focus back to add to cart when the remove button is selected. == TO TEST == a) ensure opacbookbag is set to Allow b) search for 'history', and add an item to cart via the results page c) use the 'remove' button found on the same record row as in steb b) d) press tab, and notice how the focus moves somewhere else entirely == APPLY PATCH == e) repeat steps a-c f) notice how this time the focus returns to the nearby add to cart == SIGN OFF == --- koha-tmpl/opac-tmpl/bootstrap/js/basket.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js b/koha-tmpl/opac-tmpl/bootstrap/js/basket.js index e4a9c5f5aef..41dca80f2f5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/basket.js @@ -470,7 +470,8 @@ function updateLink(val, op, target) { __("Add to cart") ) .removeClass("incart") - .addClass("addtocart cart" + val); + .addClass("addtocart cart" + val) + .focus(); target.$("a.cartR" + val).hide(); } } else { @@ -489,7 +490,8 @@ function updateLink(val, op, target) { __("Add to cart") ) .removeClass("incart") - .addClass("addtocart cart" + val); + .addClass("addtocart cart" + val) + .focus(); $("a.cartR" + val).hide(); } } -- 2.50.1 (Apple Git-155)