From: Joe Workman Date: Mon, 11 Jul 2022 23:32:26 +0000 (-0700) Subject: fix: do not overwrite aria-label if one is present X-Git-Tag: v6.7.5^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25abf249fc04a8401f014e73c59fa0c9994ce892;p=thirdparty%2Ffoundation%2Ffoundation-sites.git fix: do not overwrite aria-label if one is present closes #12447 --- diff --git a/js/foundation.util.nest.js b/js/foundation.util.nest.js index a5d468b72..d2955f994 100644 --- a/js/foundation.util.nest.js +++ b/js/foundation.util.nest.js @@ -18,9 +18,10 @@ const Nest = { if ($sub.length) { $item.addClass(hasSubClass); if(applyAria) { - $item.children('a:first').attr({ + const firstItem = $item.children('a:first'); + firstItem.attr({ 'aria-haspopup': true, - 'aria-label': $item.children('a:first').text() + 'aria-label': firstItem.attr('aria-label') || firstItem.text() }); // Note: Drilldowns behave differently in how they hide, and so need // additional attributes. We should look if this possibly over-generalized