]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix(reveal): mark correct aria-haspopup value for modal opening controls 12248/head
authorAntti Hukkanen <antti.hukkanen@mainiotech.fi>
Thu, 12 Aug 2021 12:05:38 +0000 (15:05 +0300)
committerAntti Hukkanen <antti.hukkanen@mainiotech.fi>
Thu, 12 Aug 2021 12:05:38 +0000 (15:05 +0300)
The correct value for `aria-haspopup` for dialog controlling
elements is "dialog", not "true" which indicates a menu element.
See: https://www.w3.org/TR/wai-aria-1.1/#dialog

js/foundation.reveal.js
test/javascript/components/reveal.js

index b20b04e327574a2554bf9457835f715f572003d2..baacfbbf850ccfaaff24a659678c56511c351b83 100644 (file)
@@ -55,7 +55,7 @@ class Reveal extends Plugin {
     this.$anchor = $(`[data-open="${this.id}"]`).length ? $(`[data-open="${this.id}"]`) : $(`[data-toggle="${this.id}"]`);
     this.$anchor.attr({
       'aria-controls': this.id,
-      'aria-haspopup': true,
+      'aria-haspopup': 'dialog',
       'tabindex': 0
     });
 
index 1c20797a8ec1dacd08bb0e9436398c75bfa551fc..224e88891621a76d2a4b0af3626cbee632d4d272 100644 (file)
@@ -48,7 +48,7 @@ describe('Reveal', function() {
       var $anchor = $('<button data-open="exampleModal1">Open</button>').appendTo('body');
       plugin = new Foundation.Reveal($html, {});
 
-      $anchor.should.have.attr('aria-haspopup', 'true');
+      $anchor.should.have.attr('aria-haspopup', 'dialog');
       $anchor.should.have.attr('aria-controls', $html.attr('id'));
 
       $anchor.remove();