From d56e8764a1f02a214df5da1cc95191be2da2491b Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Mon, 1 Mar 2021 17:59:29 +0000 Subject: [PATCH] Button widget: apply aria-expanded attribute when controlling a popup Addresses (1) and (5) from #5519 --- core/modules/widgets/button.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/modules/widgets/button.js b/core/modules/widgets/button.js index 5b15c875f..9186e1808 100644 --- a/core/modules/widgets/button.js +++ b/core/modules/widgets/button.js @@ -66,6 +66,9 @@ ButtonWidget.prototype.render = function(parent,nextSibling) { if(this["aria-label"]) { domNode.setAttribute("aria-label",this["aria-label"]); } + if(this.popup || this.popupTitle) { + domNode.setAttribute("aria-expanded",isPoppedUp ? "true" : "false"); + } // Set the tabindex if(this.tabIndex) { domNode.setAttribute("tabindex",this.tabIndex);