From 817056369324fc2a9166ff675f106018ee237c98 Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Wed, 26 May 2021 20:45:10 +0300 Subject: [PATCH] FIX: Make poll options tabbable (#13159) --- .../poll/assets/javascripts/widgets/discourse-poll.js.es6 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 b/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 index 08a0235248..1a47c2488e 100644 --- a/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 +++ b/plugins/poll/assets/javascripts/widgets/discourse-poll.js.es6 @@ -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", {