From b5f27c89828d0189197b233e675ab334b7bfa755 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 21 Dec 2022 14:01:05 +0800 Subject: [PATCH] fix: upgrade rc-table for a11y issue (#39700) * fix: upgrade rc-table for a11y issue * test: add test case for a11y --- components/table/__tests__/Table.test.tsx | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/components/table/__tests__/Table.test.tsx b/components/table/__tests__/Table.test.tsx index a31a87547c..fdaf21d394 100644 --- a/components/table/__tests__/Table.test.tsx +++ b/components/table/__tests__/Table.test.tsx @@ -353,4 +353,11 @@ describe('Table', () => { expect(container.querySelector('thead th')).toMatchSnapshot(); }); + + // https://github.com/react-component/table/pull/855 + it('support aria-* and data-*', async () => { + const { container } = render(); + expect(container.querySelector('table')?.getAttribute('aria-label')).toBe('label'); + expect(container.querySelector('.ant-table')?.getAttribute('data-number')).toBe('123'); + }); }); diff --git a/package.json b/package.json index b04d98b213..61249273b7 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "rc-slider": "~10.0.0", "rc-steps": "~6.0.0-alpha.2", "rc-switch": "~4.0.0", - "rc-table": "~7.28.2", + "rc-table": "~7.28.3", "rc-tabs": "~12.5.1", "rc-textarea": "~0.4.5", "rc-tooltip": "~5.2.0",