From 33bd30babc1a9ecfb0a7953afe94a54217b701cd Mon Sep 17 00:00:00 2001 From: Antti Hukkanen Date: Thu, 12 Aug 2021 15:05:38 +0300 Subject: [PATCH] fix(reveal): mark correct aria-haspopup value for modal opening controls 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 | 2 +- test/javascript/components/reveal.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/foundation.reveal.js b/js/foundation.reveal.js index b20b04e32..baacfbbf8 100644 --- a/js/foundation.reveal.js +++ b/js/foundation.reveal.js @@ -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 }); diff --git a/test/javascript/components/reveal.js b/test/javascript/components/reveal.js index 1c20797a8..224e88891 100644 --- a/test/javascript/components/reveal.js +++ b/test/javascript/components/reveal.js @@ -48,7 +48,7 @@ describe('Reveal', function() { var $anchor = $('').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(); -- 2.47.2