From 180400b2b8089c43058e2945635d61a8edc788ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Busqu=C3=A9?= Date: Fri, 21 Jul 2023 13:03:21 +0200 Subject: [PATCH] Make admin pagination accessible We label the pagination icon wrappers with "aria-label", while hiding the icon itself to screen readers. We also mark as "aria-disable"'d when the first/last page is reached. --- .../components/solidus_admin/base_component.rb | 2 +- .../ui/table/pagination/component.html.erb | 16 ++++++++-------- .../ui/table/pagination/component.yml | 3 +++ 3 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 admin/app/components/solidus_admin/ui/table/pagination/component.yml diff --git a/admin/app/components/solidus_admin/base_component.rb b/admin/app/components/solidus_admin/base_component.rb index 1e0695bda57..612c833c860 100644 --- a/admin/app/components/solidus_admin/base_component.rb +++ b/admin/app/components/solidus_admin/base_component.rb @@ -14,7 +14,7 @@ class BaseComponent < ViewComponent::Base def icon_tag(name, **attrs) href = image_path("solidus_admin/remixicon.symbol.svg") + "#ri-#{name}" tag.svg( - class: attrs[:class], + **attrs ) do tag.use( "xlink:href": href diff --git a/admin/app/components/solidus_admin/ui/table/pagination/component.html.erb b/admin/app/components/solidus_admin/ui/table/pagination/component.html.erb index d5fad852a04..67feede010b 100644 --- a/admin/app/components/solidus_admin/ui/table/pagination/component.html.erb +++ b/admin/app/components/solidus_admin/ui/table/pagination/component.html.erb @@ -3,24 +3,24 @@