FIX: Make poll options tabbable (#13159)

This commit is contained in:
Bianca Nenciu 2021-05-26 20:45:10 +03:00 committed by GitHub
parent 787f989fb9
commit 8e1448487f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -58,7 +58,7 @@ createWidget("discourse-poll-option", {
tagName: "li",
buildAttributes(attrs) {
return { "data-poll-option-id": attrs.option.id };
return { tabindex: 0, "data-poll-option-id": attrs.option.id };
},
html(attrs) {
@ -83,6 +83,12 @@ createWidget("discourse-poll-option", {
this.sendWidgetAction("toggleOption", this.attrs.option);
}
},
keyDown(e) {
if (e.keyCode === 13) {
this.click(e);
}
},
});
createWidget("discourse-poll-load-more", {