From 6a73024de5949b5ca544451413e6180398888f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Rame=CC=81?= Date: Mon, 25 Mar 2024 14:22:49 +0100 Subject: [PATCH] fix(sb): disable a11y rules that are always failing with datagrid structure --- .storybook/preview.jsx | 12 ++++++++++++ src/pages/api/dataset/initiatives.ts | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.storybook/preview.jsx b/.storybook/preview.jsx index 2ab41bd..fb7344f 100644 --- a/.storybook/preview.jsx +++ b/.storybook/preview.jsx @@ -107,6 +107,18 @@ export const parameters = { id: 'aria-valid-attr-value', selector: '*:not([aria-controls="fr-theme-modal"])', }, + { + // When using the `DataGrid` it says: "Element has children which are not allowed" + // whereas it has `role="rowgroup"` as direct nested elements... it seems a false-positive so ignoring it + // (multiple posts on internet mentions this wrong trigger) + id: 'aria-required-children', + selector: '*:not(.MuiDataGrid-root)', + }, + { + // Cannot add the missign piece triggering the error + id: 'scrollable-region-focusable', + selector: '*:not(.MuiDataGrid-virtualScroller)', + }, { // `react-dsfr` uses the same id for desktop and mobile for their quick access items id: 'duplicate-id-active', diff --git a/src/pages/api/dataset/initiatives.ts b/src/pages/api/dataset/initiatives.ts index 73a81e4..a318596 100644 --- a/src/pages/api/dataset/initiatives.ts +++ b/src/pages/api/dataset/initiatives.ts @@ -67,7 +67,6 @@ export async function handler(req: NextApiRequest, res: NextApiResponse) { }, }, }, - take: 5, orderBy: { name: 'asc', },