From 04c28ba5f23dc62c0be68c45e403fb7ebd497984 Mon Sep 17 00:00:00 2001 From: saqimtiaz Date: Wed, 5 Feb 2020 13:14:38 +0100 Subject: [PATCH] Add tabindex support to button widgets (#4442) This pull request adds support for specifying a tabindex for button widgets following the same pattern as the LinkWidget. --- core/modules/widgets/button.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/modules/widgets/button.js b/core/modules/widgets/button.js index 34472309f..592e4c722 100644 --- a/core/modules/widgets/button.js +++ b/core/modules/widgets/button.js @@ -64,6 +64,10 @@ ButtonWidget.prototype.render = function(parent,nextSibling) { if(this["aria-label"]) { domNode.setAttribute("aria-label",this["aria-label"]); } + // Set the tabindex + if(this.tabIndex) { + domNode.setAttribute("tabindex",this.tabIndex); + } // Add a click event handler domNode.addEventListener("click",function (event) { var handled = false; @@ -205,6 +209,7 @@ ButtonWidget.prototype.execute = function() { this.setField = this.getAttribute("setField"); this.setIndex = this.getAttribute("setIndex"); this.popupTitle = this.getAttribute("popupTitle"); + this.tabIndex = this.getAttribute("tabindex"); // Make child widgets this.makeChildWidgets(); };