From 8d8e314787621654e16f9c0e5dfb00c7061fb13c Mon Sep 17 00:00:00 2001 From: daria <95225431+dariiing@users.noreply.github.com> Date: Tue, 24 Jun 2025 11:55:18 +0300 Subject: [PATCH] make poll questions accessible for keyboard #1966 --- www/form/app-form.less | 10 ++++++++++ www/form/inner.js | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/www/form/app-form.less b/www/form/app-form.less index eb6de3ce8..b896e9962 100644 --- a/www/form/app-form.less +++ b/www/form/app-form.less @@ -1254,9 +1254,12 @@ .cp-poll-switch { button.btn { border-radius: 0; + background-color: transparent; + box-shadow: none; &:focus-visible { outline: @variables_focus_style; border-radius: @variables_radius; + border: 0; } } } @@ -1368,6 +1371,13 @@ background: @cp_form-poll-maybe; .cp-maybe { display: inline; } } + &:focus-visible { + outline: @variables_focus_style; + border-radius: @variables_radius; + } + &:last-of-type { + margin-right: 0.2rem; + } } div.cp-form-poll-choice { cursor: pointer; diff --git a/www/form/inner.js b/www/form/inner.js index 844705e23..20f669c10 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -2590,8 +2590,8 @@ define([ var $c = $(cell); $c.data('option', data); var val = 0; - $c.attr('data-value', val); - $c.click(function () { + $c.attr('data-value', val).attr('tabindex', '0'); + Util.onClickEnter($c, function () { if (disabled) { return; } val = (val+1)%3; $c.attr('data-value', val);