From b584a365ec2949714ba777ac05bcd526d2545a02 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Thu, 26 Aug 2021 13:58:08 -0700 Subject: [PATCH] fix: relocate menu aria attrs closes #12087 --- js/foundation.util.nest.js | 2 +- test/javascript/components/drilldown.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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()); }); }); -- 2.47.2