From cfa7311fd4fcd0f8b0a284ab2db9318faf850cc8 Mon Sep 17 00:00:00 2001 From: Krishna Dhakal <7krishna7dhakal7@gmail.com> Date: Sat, 21 Oct 2023 10:38:00 +0545 Subject: [PATCH] a11y: Fix no-static-element-interactions in xy chart editor (#76170) Co-authored-by: nmarrs --- .../app/plugins/panel/xychart/ManualEditor.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/panel/xychart/ManualEditor.tsx b/public/app/plugins/panel/xychart/ManualEditor.tsx index a63ee4470fc..d4ec2b67fe4 100644 --- a/public/app/plugins/panel/xychart/ManualEditor.tsx +++ b/public/app/plugins/panel/xychart/ManualEditor.tsx @@ -66,9 +66,19 @@ export const ManualEditor = ({
{value.map((series, index) => { return ( - // TODO: fix keyboard a11y - // eslint-disable-next-line jsx-a11y/no-static-element-interactions -
setSelected(index)}> +
setSelected(index)} + role="button" + aria-label={`Select series ${index + 1}`} + tabIndex={0} + onKeyPress={(e) => { + if (e.key === 'Enter') { + setSelected(index); + } + }} + > onFieldChange(v, index, 'name')}