From: Joe Workman Date: Thu, 26 Aug 2021 20:58:08 +0000 (-0700) Subject: fix: relocate menu aria attrs X-Git-Tag: v6.7.1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b584a365ec2949714ba777ac05bcd526d2545a02;p=thirdparty%2Ffoundation%2Ffoundation-sites.git fix: relocate menu aria attrs closes #12087 --- diff --git a/js/foundation.util.nest.js b/js/foundation.util.nest.js index 661c92d79..df86d8f32 100644 --- a/js/foundation.util.nest.js +++ b/js/foundation.util.nest.js @@ -20,7 +20,7 @@ const Nest = { if ($sub.length) { $item.addClass(hasSubClass); if(applyAria) { - $item.attr({ + $item.children('a:first').attr({ 'aria-haspopup': true, 'aria-label': $item.children('a:first').text() }); diff --git a/test/javascript/components/drilldown.js b/test/javascript/components/drilldown.js index a33c77dbc..06c98271e 100644 --- a/test/javascript/components/drilldown.js +++ b/test/javascript/components/drilldown.js @@ -77,9 +77,9 @@ describe('Drilldown Menu', function() { }); plugin.$element.find('.is-drilldown-submenu-parent').each(function() { - $(this).should.have.attr('aria-haspopup', 'true'); $(this).should.have.attr('aria-expanded', 'false'); - $(this).should.have.attr('aria-label', $(this).children('a').first().text()); + $(this).children('a').first().should.have.attr('aria-haspopup', 'true'); + $(this).children('a').first().should.have.attr('aria-label', $(this).children('a').first().text()); }); });