Upcoming accessibility challenges in MUI components

I'm currently in the process of developing a react application using MUI (Core & X) and encountering some challenges with WCAG Accessibility. Although I am utilizing various components provided by MUI, I am facing issues specifically with the data grid, select, and MUI tabs. The versions of MUI that I am working with are:

"@mui/material": "^5.13.5", "@mui/styled-engine-sc": "^5.8.0", "@mui/x-data-grid": "^5.17.8",

The problems I have identified include:

  • The Wave Evaluation Tool (an accessibility test) is flagging a Form Label Missing Error whenever there's a dropdown arrow within the MUI Data Grid (after rows per page).
  • This issue is also present in any of the MUI Select Component (dropdown for selection). More details can be found here: [Data Grid] (https://i.stack.imgur.com/3U3Cv.png)
  • Additionally, there is a Broken-Aria Reference error occurring in the MUI Tabs component. Broken-Aria Reference

I am unsure if these limitations are inherent in MUI or if I may be overlooking something. Any insights would be greatly appreciated. Thank you in advance.

Best regards, Huzaifa

Answer №1

Both of your initial mistakes are identical. The table pagination is using a MUI Select Component, which is causing the issue in both cases. To test the grid, I utilized a demo page from MUI Data Grid.

https://mui.com/x/react-data-grid/pagination/

The coding for the MUI Select appears unconventional:

<input aria-invalid="false" aria-hidden="true" tabindex="-1"
  class="MuiSelect-nativeInput css-1k3x8v3" value="5">

This coding includes aria-hidden="true", making the <input> hidden from screen readers and other assistive technologies. Additionally, it features tabindex="-1", preventing keyboard users from tabbing to it. Consequently, users cannot focus on the <input>. Although this non-standard approach confuses the WebAIM WAVE tool, the error can be disregarded.

For the MUI Select, the <input> should ideally have display:none instead of aria-hidden and tabindex. This adjustment would eliminate the WAVE error while preserving the intended functionality. It may be advisable to report this issue to MUI.

Your third error related to MUI Tabs could not be reproduced when testing with https://mui.com/material-ui/react-tabs/. The basic structure of the tabs is as follows:

<div aria-label="basic tabs example" role="tablist">
  <button role="tab" aria-selected="true"  id="simple-tab-0">Item One</button>
  <button role="tab" aria-selected="false" id="simple-tab-1">Item Two</button>
  <button role="tab" aria-selected="false" id="simple-tab-2">Item Three</button>
</div>
...
<div role="tabpanel" id="simple-tabpanel-0" aria-labelledby="simple-tab-0"></div>
<div role="tabpanel" id="simple-tabpanel-1" aria-labelledby="simple-tab-1" hidden=""></div>
<div role="tabpanel" id="simple-tabpanel-2" aria-labelledby="simple-tab-2" hidden=""></div>

Each <button> is assigned an ID (such as "simple-tab-0", 1, 2), and later, each

<div role="tabpanel">
has aria-labelledby that corresponds to one of the button IDs. This standard practice explains why the demo page does not generate WAVE errors.

In the provided screenshot, the issue arises where the third <div> with

aria-labelledby="simple-tab-2"
is erroneously highlighted. If this occurs, it indicates that the corresponding <button> with id="simple-tab-2" is missing.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Tips for utilizing the "get" method in React to submit a form

Is there a way to submit a form using the "get" method to an external URL in react? Similar to how it is done in HTML like in this example: https://www.example.com/form But instead, to a third party URL...? Can I achieve something like this? The goal is ...

Tips for integrating the react-financial-charts library into your React and JavaScript project

While exploring the react-financial-charts library, I discovered that it is written in TypeScript (TS). Despite my lack of expertise in TypeScript, I am interested in using this library in my React+JS project due to its active contributions. However, I hav ...

Handlers for adjustments not correctly updating values in introduced object

I am facing an issue with a table that displays data fetched from an API and a select dropdown. Whenever a checkbox is selected, the name key along with its value is added to an array object named selectedFields. checkbox = ({ name, isChecked }) => { ...

Error in React+Redux: Trying to access the "address" property of a null value is not permitted

I am new to using react and encountering an issue with my ecommerce app. The app runs smoothly until I log out and then log back in at the shipping address page, which triggers the following error: TypeError: Cannot read property 'address' of nu ...

The variable 'API_URL' has been given a value, however, it is not utilized in the code

What could be the issue causing this error? The problem seems to lie with API_URL and title not functioning correctly. The error message displayed is "Unexpected template string expression." const API_URL ='http://www.omdbapi.com?apikey=ed015dd' ...

Is it possible to scope component styles instead of using inline styles in order to avoid being overwritten by multiple React applications on a single webpage?

My application contains the following HTML: <div id="react-root-navbar"></div> <div id="react-root-body"></div> Along with React components that utilize React.DOM.render on each div. Both React components utili ...

"Encountering issues with React, Webpack, and Material UI styling when deploying to

Attempting to construct a reusable React component with Material UI and then link it using npm to another application. Both the component and application are bundled through webpack. While the application successfully renders the component during developme ...

Utilizing the DirectusImage tag for a stylish background effect

I'm new to Directus and I need help styling a card with a background image from a Directus Image. Can anyone guide me on how to achieve this? Here's what I have tried: <Card style={{backgroundImage:"url({someColletion.image.id})" &g ...

When using the command npx create-react-app myapp, it produces a FETCH_ERROR

npm ERROR! FETCH_ERROR occurred npm ERROR! FETCH_ERROR code returned npm ERROR! Received invalid JSON response from http://registry.npmjs.org/@typescript-eslint%2fparser due to Unexpected numeric value in JSON at character position 80754 No solutions hav ...

The issue lies with the React router not functioning properly when handling root

My React Router is functioning correctly, but I encounter an error when adding params to the router. The specific error displayed is "Uncaught SyntaxError: Unexpected token <". import React from 'react'; import ReactDOM from 'react-dom ...

Error encountered when importing a Material-UI component: Unable to load a module from @babel/runtime

Struggling to compile the index.js file with rollup: import React from "react"; import ReactDOM from "react-dom"; import Grid from "@material-ui/core/Grid"; ReactDOM.render( <React.StrictMode> <Grid conta ...

Encountering issues post upgrading Material-ui from version 4 to 5 while utilizing a component with react-number-format

I recently updated my material-ui version from v4 to v5, but I'm encountering issues with a component that utilizes the react-number-format library. It seems like the problem is related to forwarding refs, and despite my efforts, I haven't been a ...

Using the className prop with child components in Material-UI

Can a css class be assigned to the inner elements of a Material-UI component? For example, if we take the <RaisedButton /> component, how can a className be applied to the label element inside Raised Button? <RaisedButton labelStyle={{...}}. Giv ...

Prisma is continuously spitting out data beyond my jurisdiction

I'm currently working on a project that involves postgreSQL and Prisma. While debugging in getServerSideProps(), I noticed that Prisma is automatically console.logging long strings like the following: prisma:query SELECT "public"."TaskC ...

What are the steps to resolving an issue with importing a css file in next.js?

Error: ./node_modules/quill-emoji/dist/quill-emoji.css ModuleParseError: Module parse failed: Unexpected character '�' (1:0) You may need a suitable loader for handling this file type, as there are currently no configured loaders to process it. ...

Step-by-step guide on aligning cards horizontally in Material UI with equal height

I'm relatively new to material ui and I'm struggling to make all the cards in the image the same height. I've tried adding a height of 100% to the card component but haven't been successful so far :/ Any suggestions on how to achieve ca ...

What is the best way to retrieve the name and ID values from a select

Using react hooks, I have created a select component. Currently, I am able to retrieve the id of the selected country but not the name. Here is the code for the select component: const [countries, setCountries] = useState([]); const [selectedCountry, set ...

Updating components in Next.js 13 application directory by syncing changes from server to client

I am experimenting with the new features in Next.js 13 within the app directory, and I aim to recreate certain functionalities that I currently have in the traditional pages directory. My goal is to showcase a grid of cards, each representing a different h ...

Unique rephrased text: "Varied wrapping styles in both

Feeling frustrated with a seemingly commonplace issue. Despite the thousands of times it has been asked before, I can't seem to find an answer on Google. I wanted to neatly display my text within one of my cards, but so far I've only achieved th ...

Attempting to set up node-sass through npm

Encountering an error while trying to install node-sass via npm at any version has left me puzzled. I've gone through several troubleshooting steps: updating node-sass to the latest version updating all dependencies and adjusting webpack.config.js a ...