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.
This commit is contained in:
saqimtiaz
2020-02-05 12:14:38 +00:00
committed by GitHub
parent b9d20f1868
commit 04c28ba5f2
+5
View File
@@ -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();
};