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 13:14:38 +01:00 committed by GitHub
parent b9d20f1868
commit 04c28ba5f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

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();
};